Give compiler workers a 4M-word minor heap
Why
Every minor collection in OCaml 5 stops all domains until the slowest one has emptied its heap, so busy compiler workers stall each other. With the forced collections of JSX translation gone, a larger minor heap cuts the collections by about 30% and clean build CPU by about 10% on a JSX-heavy project with 7 workers.
The 2M-word heap was chosen while translating JSX still copied all 591 labels of the DOM props record per element. Each copy forced a minor collection of all domains, and 4M words were no faster than 2M then. 8M words added memory for little more speed.
Review
- What does it cost? 16 MB more minor heap per worker while a build runs, about 200 MB more peak memory on a 552 module app with 7 workers. OCaml 5.5, which the release builds use, decommits a finished domain's minor heap, so idle watch sessions don't keep the worker heaps.