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

opened this

Merged 21h 11m ago, live in production

hollow-no-gc → main 0 commits 1 thread · 1 unresolved

  • Merged. hollow-no-gc was merged into main as 954e20f.

Review

Sign in to review this change.
1 file changed +2 −5
scripts/hollow.ts +2 −5
@@ -565,7 +565,6 @@ const readBefore = new Map<string, { text: string; module: Module }>();
565565 /** Every hollow action and orphan screen in `sources`. */
566566 export function hollow(sources: Sources): Hollow[] {
567567 const modules = new Map<string, Module>();
568 let parsed = 0;
569568 for (const [file, text] of sources) {
570569 const before = readBefore.get(file);
571570 if (before !== undefined && before.text === text) {
@@ -574,11 +573,9 @@ export function hollow(sources: Sources): Hollow[] {
574573 }
575574 const module = read(file, text);
576575 readBefore.set(file, { text, module });
576 // No forced collection here: a full Bun.gc(true) every 64 files doubled the audit's CPU

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.

577 // (30 s against 15 s on a runner) and raised its peak (547 MiB against 450 MiB).
577578 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);
582579 }
583580 const edges = graph(modules);
584581 // The palette lists src/tui/screens/ and loads each file that declares an entry, so they run

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs