Incremental compilation

Batch-intern ceiling measurement + proof

The question

How much does re-interning shared indexes actually cost, and how much would a compile daemon (or in-process batching) claw back?

The measurement

Added -d:idxProfile timing around the single load() seam in programs.nim (per-suffix cold/warm parse+intern counts, dumped by nimsem / hexer), and fixed the latent -d:vfsProfile build (missing std/monotimes import in vfs.nim).

Ceiling (tall.nim, 41 imports, 164 procs): system.s.idx.nif was re-interned 107×, ~505ms aggregate CPU; ~642ms across all indexes (aggregate, partly hidden by nifmake parallelism).

The proof

Running 20 independent modules in one nimsem m invocation (shared prog / pool via semcheckCycleGroup) interns system once instead of 20× (cold 20→1), cutting index parse+intern CPU 91.6ms → 8.6ms and giving ~1.3× wall.

Recommendation (docs/daemon-prototype-findings.md): ship in-process depth-batching (reuses the existing cycle-group path, no IPC) before the full nimsem serve daemon.

Files touched: nimony/programs.nim, nimony/vfs.nim, experiment script, docs/daemon-prototype-findings.md.


Back to top

aoughwl — next-gen self-hosted platform for things n stuff. Reach out on Discord (timbuktu_guy) for access to the private backends.

This site uses Just the Docs, a documentation theme for Jekyll.