Test sharding planner
Paste your slowest test files with their durations, choose how many parallel shards you want, and get a balanced split with the expected wall-clock time.
- Expected wall time
- 9m 8s
- serial: 31m 33s
- Speedup
- 3.45x
- Balance
- 98%
- 100% is perfect
| Shard | Tests | Test time | With setup | Contents |
|---|---|---|---|---|
| 1 | 3 | 7m 32s | 9m 2s | search/index.test.ts, auth/login.test.ts, api/users.test.ts |
| 2 | 3 | 7m 24s | 8m 54s | e2e/smoke.test.ts, billing/refund.test.ts, billing/tax.test.ts |
| 3 | 4 | 7m 38s | 9m 8s | billing/invoice.test.ts, ui/dashboard.test.ts, api/webhooks.test.ts, ui/settings.test.ts |
| 4 | 4 | 7m 29s | 8m 59s | ui/checkout.test.ts, api/orders.test.ts, search/query.test.ts, auth/session.test.ts |
Everything runs in your browser; nothing you type is sent anywhere.
How to use it
- Paste one test per line as name and seconds. Most test runners can print per-file timings.
- Set the number of shards and the fixed overhead each shard pays for checkout, install and warm-up.
- Use the shard lists to configure your matrix, then compare the expected wall time with your current run.
Frequently asked questions
How are shards balanced?
With the longest-processing-time-first rule: sort tests from longest to shortest and always add the next one to the least loaded shard. It is simple and within a third of optimal in the worst case.
Why doesn't doubling shards halve the time?
Every shard repeats the fixed setup (checkout, install, build), and a single long test caps how short any shard can be.
What does sharding do to my bill?
You pay for every shard's setup, so minutes go up even though wall time goes down. Use the overhead field to see the trade-off.
How do I shard in Jest, Playwright or pytest?
Jest and Playwright have --shard=i/n, and pytest has plugins like pytest-split. Use this plan if you need duration-aware splits rather than count-based ones.
Related guides
- Pytest Slow Tests: Find, Mark, Skip and Speed Up (xdist)Pytest slow tests: find them with --durations, mark and skip them by default, then speed up with pytest-xdist and by splitting the suite across CI jobs.
- Test Sharding: Meaning, Jest, Gradle, Bazel and MoreTest sharding explained: what it means and how to shard Jest, Playwright, Vitest, Gradle, Bazel, Flutter, dotnet and Android tests in GitHub Actions.
- Cypress Tests Slow? How to Speed Up CypressCypress tests slow in CI? How to speed up Cypress with cy.session, intercepts and no fixed waits, plus Cypress parallel tests in GitHub Actions.
- Playwright Tests Slow in CI? Fix With Workers, ShardingPlaywright tests slow in CI? Speed them up with more workers, reused storageState, cached browsers and --shard test sharding. Python included.
Embed this calculator on your site
Free to embed on blogs and docs. Paste this HTML where you want it to appear:
<iframe src="https://compiler.dev/embed/test-sharding-planner" title="Test sharding planner" width="100%" height="560" style="border:1px solid #e5e7eb;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px">Calculator by <a href="https://compiler.dev/tools/test-sharding-planner">compiler.dev</a></p>Related tools
- GitHub Actions matrix expanderSee every job a GitHub Actions strategy.matrix creates, with include and exclude applied, and the total job count against the 256-job limit.
- CI minutes forecasterForecast monthly CI minutes and GitHub Actions cost from pull requests per day, pushes per PR, jobs per run and minutes per job. Plan and runner aware.
- Cost of slow CI calculatorWork out what slow CI costs your team each year from engineers, waits per day, minutes per wait and hourly cost, plus the saving from faster builds.
- GitHub Actions cache key builderBuild a correct actions/cache key with hashFiles patterns and restore-keys for npm, pnpm, pip, Gradle, Maven, Go, Cargo and more. Copy-ready YAML.