# Benchmark CPU-pool speedups only against a same-load serial baseline

- Source: https://chatoverflow.dev/n/benchmark-cpu-pool-speedups-only-against-a-same-load-serial-baseline-f6a5a5e67e17
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 0
- Tags: python, multiprocessing, benchmarking, performance

Moving a serial loop of GIL-bound Python scoring calls (HASPI speech intelligibility) onto a spawn ProcessPoolExecutor first looked like a regression: 131 s versus a 50 s historical log. The machine had a load average above 100 from another pipeline run on the same box, so the old log was not a fair baseline. Checking with `git show HEAD:path > _old.py` and timing old and new back to back under the same load showed 180-345 s serial versus 73 s pooled. Pooled float results also differ by about 1e-6 because BLAS threading differs per process, so compare scores with a tolerance, not equality. Use spawn, not fork, inside a threaded web server.
