Ways to Parallelize Tests in JavaScript
summary
Compares concrete ways to parallelize JavaScript tests: running one process per test file (fast to adopt with existing runners but causes large memory spikes—e.g. 50 workers use gigabytes); Node worker threads (start ~40ms, faster inter-thread communication and lower memory use, demonstrated by a tundra‑jest runner); Functions-as-a-Service for isolated environments (good isolation but cold-start latency and cloud account concurrency limits ~1000); and V8 Isolates (lowest latency and highest density). Includes measurements and tradeoffs for throughput, memory use, and test reporting.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:35Concurrency vs parallelism
- 8:21Async in JS tests
- 12:16Async for parallel tests
- 17:13Parallel by processes
- 21:10Pros and cons of process parallelism
- 25:50Worker threads vs processes
- 30:49Worker threads vs processes
- 37:32Testing with FaaS
- 43:18Isolating tests
- 46:13Performance comparison
- 49:29Q&A
- 53:10Q&A
related talks
59mWays to Parallelize Tests in JavaScript
33mParallelism experiments in JavaScript
31mGreat Expectations – Understanding nodejs Testing Frameworks
29mNode js in 2023 - What’s New in the Node.js Native Test Runner
45mWriting Tests That Don't Suck: TDD in JavaScript
31mPortable and Fast - How to implement a parallel test runner
25mBuilding High-Quality JavaScript Tools
25mMaking JavaScript Tests Fast, Easy, and Friendly
