- All playbooks
- Parallelization and sharding
- Weight memory-heavy steps so build and test run in parallel on separate agents
Weight memory-heavy steps so build and test run in parallel on separate agents
Give heavy operations a weight, so the scheduler never places build and test on the same agent.
How DoorDash used this technique
Read what DoorDash changed and follow the original sources.
Weight memory-heavy steps so build and test run in parallel on separate agents
Translated to GitHub Actions
- What DoorDash built
- DoorDash finished and extended weighted operations in Rush, so an agent starts an operation only when its memory weight fits.
- Your GitHub Actions version
- Run build and test as parallel jobs on separate runners, sized to the memory each needs.
Once its Next.js build no longer needed a pre-compile step, DoorDash could start Jest tests alongside the build. The build needs 12 GB of memory and the tests need 20 GB, so the two could never share an agent. DoorDash finished and extended weighted operations in Rush upstream, building on earlier work: each operation declares how many concurrency units it takes, and an agent starts an operation only when its weight fits. Build and test then ran in parallel on different agents, halving CI time to 11 minutes. DoorDash's Kotlin build service schedules by memory the same way, with tokens sized from each project's past memory use.
- Use it when
- Two heavy steps run one after the other because running them together on one runner would exhaust its memory.
- Before applying it
- Weights stand in for memory or CPU, so measure each step's peak memory before you set them, and re-measure as the suite grows.
- GitHub Actions adaptation
- Compare the source system with your own workflow before applying this translation.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed