You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
build: 94% of build time is directory churn (wipe dist, mkdir per entry); 32 s here, minutes on slow disks #80
Why it matters
The CI comment says "the whole run takes seconds", and the JS does: rendering, checks and escaping total under half a second. On a Windows drive the build takes 32 s, and on a slow or network drive several minutes, because dist/ is deleted and recreated every run and every one of the 420 pages gets its own mkdirSync({recursive: true}). The local edit-preview loop is the contributor's main tool, and at 2,000 entries this becomes about two minutes per build.
Evidence
--cpu-prof of a 25.7 s build on 2026-10-21: mkdir 18.4 s, rmSync 3.5 s, writeFile 1.9 s, all JavaScript < 0.5 s.
site/build.mjs:563-564 wipes dist/; :472-473 (entries) and :417-418 (stacks) call mkdirSync per page (about 44 ms each on this drive).
Stop wiping dist/. Create dist/entry and dist/stack once, mkdirSync a page directory only if it is missing, write a file only when its content differs (compare bytes), and remove only entry/stack directories whose id is no longer in the catalog.
Add --only <id> (build one entry page plus data) and --no-clean flags for the local loop.
Also exit on entry errors before loading stacks (build.mjs:501-514), so a broken entry does not hide stack errors until a second run.
Record the before/after timing in the PR.
Done when
A no-change rebuild completes in under 3 s on the same machine, output is byte-identical to a clean build, and --only works.
Activity
Open issues sweep: validation types, incremental build, added dates, …