<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb" -->

---
title: Optimizing Test Runtime: Playwright Sharding vs. Workers
description: A comparison of Playwright's two built-in parallelization strategies: workers (multiple processes on one machine) versus sharding (distribution across multiple...
canonical: https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Optimizing Test Runtime: Playwright Sharding vs. Workers | daily.dev
og:description: A comparison of Playwright's two built-in parallelization strategies: workers (multiple processes on one machine) versus sharding (distribution across multiple...
og:url: https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb
og:image: https://api.daily.dev/og/posts/59Kyhq9Eb.png
og:image:alt: Optimizing Test Runtime: Playwright Sharding vs. Workers
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimizing Test Runtime: Playwright Sharding vs. Workers

**[Currents](https://daily.dev/sources/currents)** · 16 min read · 0 upvotes · 0 comments

## Summary

A comparison of Playwright's two built-in parallelization strategies: workers (multiple processes on one machine) versus sharding (distribution across multiple CI machines). Workers suit suites in the hundreds of tests, are simple to configure, and dynamically rebalance within a machine, but are bounded by single-machine CPU/memory. Sharding scales beyond one machine but splits test files alphabetically, causing static load imbalance, environment inconsistency, and dependency issues. A third option, test orchestration, replaces static allocation with a real-time task queue that distributes tests based on actual duration data. A case study describes FundGuard cutting an 80-minute Playwright E2E suite to 40 minutes using Currents Orchestration, and cutting CI costs by 50-90% by combining orchestration with spot instances.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://currents.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers>

## Questions this post answers

### Should I use Playwright workers or sharding to speed up my CI test suite?

Use workers first if your suite is in the hundreds of tests (roughly 100-800) and fits within a single machine's CPU/memory, since they're simpler to configure and dynamically rebalance as processes finish. Move to sharding once single-machine runtime exceeds about 30 minutes with workers maxed out, typically for suites of 500+ tests, since sharding scales across CI machines but splits files statically and alphabetically.

_Compare parallelization tradeoffs like this one on daily.dev before restructuring a CI pipeline._

### Why does Playwright sharding leave some CI machines idle while others are still running?

Playwright splits test files into shards alphabetically by discovery order, not by execution time, so a shard containing several slow files can run far longer than a shard with fast ones. For example, two shards split from four files (12, 10, 3, and 2 minutes) can produce one shard taking 20 minutes and another finishing in 5, leaving that machine idle for 15 minutes since the whole run waits for the slowest shard.

_Track CI bottlenecks like uneven test sharding by following testing engineering deep dives on daily.dev._

### How much faster did test orchestration make FundGuard's Playwright E2E suite compared to native sharding?

Currents Orchestration cut FundGuard's 80-minute Playwright end-to-end suite down to 40 minutes, a 50% reduction, by distributing tests based on actual historical duration data instead of alphabetical file order. Native Playwright sharding alone had already reduced runtime somewhat but still left the static split problem where some shards finished much faster than others.

_See real-world CI optimization results like this one surfaced on daily.dev when evaluating test orchestration tools._

## Similar posts on daily.dev

- [I Thought My E2E Tests Were Slow Because of Bad Selectors. I Was Wrong.](https://daily.dev/posts/i-thought-my-e2e-tests-were-slow-because-of-bad-selectors-i-was-wrong--fb8bziaos) · Medium · 0 upvotes · 0 comments
- [Playwright Tags and Annotations: Organize Large CI Suites](https://daily.dev/posts/playwright-tags-and-annotations-organize-large-ci-suites-s0yxpg2ir) · Currents · 0 upvotes · 0 comments
- [Selenium vs Cypress vs Playwright: Choosing Your Test Automation Framework](https://daily.dev/posts/selenium-vs-cypress-vs-playwright-choosing-your-test-automation-framework-3uxew2qph) · Stack Overflow Blog · 5 upvotes · 0 comments
- [Stop restarting your tests](https://daily.dev/posts/stop-restarting-your-tests-ns9dk3caa) · Temporal · 0 upvotes · 0 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#cicd](https://daily.dev/tags/cicd)

[View this post on daily.dev](https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Optimizing Test Runtime: Playwright Sharding vs. Workers","url":"https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb"},"datePublished":"2026-09-06T08:56:40.755Z","dateModified":"2026-09-06T12:17:18.483Z","description":"A comparison of Playwright's two built-in parallelization strategies: workers (multiple processes on one machine) versus sharding (distribution across multiple...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e9e8283f29421b763073033a49895f4a?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/e9e8283f29421b763073033a49895f4a?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Currents","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Currents","logo":"https://media.daily.dev/image/upload/s--RxsiMZ1S--/f_auto,q_auto/v1788684994/logos/currents?_a=BAMAMicg0","url":"https://daily.dev/sources/currents"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"testing,cicd","timeRequired":"PT16M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Currents","item":"https://daily.dev/sources/currents"},{"@type":"ListItem","position":3,"name":"Optimizing Test Runtime: Playwright Sharding vs. Workers"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/optimizing-test-runtime-playwright-sharding-vs-workers-59kyhq9eb#faq","mainEntity":[{"@type":"Question","name":"Should I use Playwright workers or sharding to speed up my CI test suite?","acceptedAnswer":{"@type":"Answer","text":"Use workers first if your suite is in the hundreds of tests (roughly 100-800) and fits within a single machine's CPU/memory, since they're simpler to configure and dynamically rebalance as processes finish. Move to sharding once single-machine runtime exceeds about 30 minutes with workers maxed out, typically for suites of 500+ tests, since sharding scales across CI machines but splits files statically and alphabetically. Compare parallelization tradeoffs like this one on daily.dev before restructuring a CI pipeline."}},{"@type":"Question","name":"Why does Playwright sharding leave some CI machines idle while others are still running?","acceptedAnswer":{"@type":"Answer","text":"Playwright splits test files into shards alphabetically by discovery order, not by execution time, so a shard containing several slow files can run far longer than a shard with fast ones. For example, two shards split from four files (12, 10, 3, and 2 minutes) can produce one shard taking 20 minutes and another finishing in 5, leaving that machine idle for 15 minutes since the whole run waits for the slowest shard. Track CI bottlenecks like uneven test sharding by following testing engineering deep dives on daily.dev."}},{"@type":"Question","name":"How much faster did test orchestration make FundGuard's Playwright E2E suite compared to native sharding?","acceptedAnswer":{"@type":"Answer","text":"Currents Orchestration cut FundGuard's 80-minute Playwright end-to-end suite down to 40 minutes, a 50% reduction, by distributing tests based on actual historical duration data instead of alphabetical file order. Native Playwright sharding alone had already reduced runtime somewhat but still left the static split problem where some shards finished much faster than others. See real-world CI optimization results like this one surfaced on daily.dev when evaluating test orchestration tools."}}]}
```

