You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dcaf957
Browse filesBrowse the repository at this point in the historyBrowse files
chore: optimize fixtures in a bounded worker pool (#2265)
## Summary
- optimize regression fixtures in worker threads orchestrated by
Tinypool
- cap optimization at two concurrent workers on memory-constrained CI
runners
- move fixture reads, synchronous optimization, checksumming, and writes
into the worker
- avoid retaining fixture contents or optimized SVGs on the main thread
- report optimization, rendering, and comparison durations separately
## Motivation
`optimize()` is synchronous, so the previous `os.cpus().length * 2`
async functions did not provide CPU parallelism. They only allowed
multiple fixture reads to complete around the active optimization,
increasing peak memory without parallelizing the expensive work.
This uses actual worker threads while bounding the number of concurrent
large ASTs to two. Tasks contain only file paths, and workers return
only checksums and byte counts.
## Benchmark
A local run over 256 fixtures sampled across the regression corpus:
- one Tinypool worker: 11.7 seconds
- two Tinypool workers: 6.6 seconds
- wall-time reduction: about 43%
The benchmark excludes the corpus's seven extreme 20–90 MB fixtures. The
two-worker cap is intentionally conservative for those files and the 8
GiB CI environment.
## Verification
- `pnpm test` — 1,554 passed, 9 skipped
- `pnpm typecheck`
- `pnpm exec eslint test/regression/optimize.js
test/regression/optimize-worker.js`
- `pnpm exec prettier --check test/regression/optimize.js
test/regression/optimize-worker.js package.json pnpm-lock.yaml`
- `git diff --check`
- Tinypool worker smoke test verified optimization output, checksum, and
byte metrics
The full regression corpus was not run locally because it is
host-dependent and includes several very large fixtures.
0 commit comments