mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-11 02:03:59 +08:00
The backlog threshold of a level backs off by doublings as backlog passes find little to free, but only passes that had candidates count. A program whose mature passes have no candidates while its heap grows keeps the base threshold, a quarter of the live heap, while those same passes widen the level's growth fraction. When it then reads the structure it built, the mature buffer fills with live objects and the first backlog pass walks a quarter of the live heap to find nothing. In tsc-ts's program build on Sentry, that pass ran inside the loader walk and took 9 to 18 ms. Until a pass at a level has had candidates, the backlog threshold now uses the level's growth fraction doublings. The first pass with candidates judges the level, and the threshold follows its own yield from then on.