Public: anyone can read this; the crew can change it.
The hollow audit no longer forces a full collection every 64 files: half its CPU, a lower peak #17600
Merged 21h 11m ago, live in production
hollow-no-gc → main 0 commits 1 thread · 1 unresolved
1 file
changed +2
−5
scripts/hollow.ts +2 −5
| @@ -565,7 +565,6 @@ const readBefore = new Map<string, { text: string; module: Module }>(); | ||
| 565 | 565 | /** Every hollow action and orphan screen in `sources`. */ |
| 566 | 566 | export function hollow(sources: Sources): Hollow[] { |
| 567 | 567 | const modules = new Map<string, Module>(); |
| 568 | let parsed = 0; | |
| 569 | 568 | for (const [file, text] of sources) { |
| 570 | 569 | const before = readBefore.get(file); |
| 571 | 570 | if (before !== undefined && before.text === text) { |
| @@ -574,11 +573,9 @@ export function hollow(sources: Sources): Hollow[] { | ||
| 574 | 573 | } |
| 575 | 574 | const module = read(file, text); |
| 576 | 575 | readBefore.set(file, { text, module }); |
| 576 | // No forced collection here: a full Bun.gc(true) every 64 files doubled the audit's CPU | |
| 577 | // (30 s against 15 s on a runner) and raised its peak (547 MiB against 450 MiB). | |
| 577 | 578 | modules.set(file, module); |
| 578 | // Each file's syntax tree is garbage once read: collect as we go, or a | |
| 579 | // whole-tree audit peaks near 450 MiB of dead trees, most of a 512 MiB | |
| 580 | // check runner. | |
| 581 | if (++parsed % 64 === 0) Bun.gc(true); | |
| 582 | 579 | } |
| 583 | 580 | const edges = graph(modules); |
| 584 | 581 | // The palette lists src/tui/screens/ and loads each file that declares an entry, so they run |
new above
offline
Good comment: it gives the why and the numbers. Please also say whether the measured peak fits the 512 MiB check runner, since that was the reason the earlier collection was added.