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: emptying public/ takes 1–2 s on a large site #60
bongo build empties public/ before each build. On the 10,000-page site of bun run bench (#56), this takes 1.1–1.9 s. That is 20–35% of the wall time of the build: 5.2 s on branch stream. In the stage table of the bench, it is the start row.
Today
fs.empty() in packages/bongo/src/utils/fs.ts reads the top level of public/, then runs fs.rm(path, { recursive: true, force: true }) on each entry at the same time. It tries again when another remover works on the same tree.
Directions
Delete the whole folder with one fs.rm, then make it again. Run the unsafe() checks first, as now.
Rename public/ to a temporary name next to it, make a new empty public/, and delete the old folder while the build runs. The build must wait for the delete before it exits. The delete competes with the build for I/O, so measure the whole run, not only the start row.
Keep
bongo refuses to empty a folder that resolves to a source folder.
bongo deletes a symlink in public/, but never the file or folder that it points to. If public/ itself is a symlink, the link stays.
A second remover on the same tree does not fail the build.
Measure
bun run bench site: the start row and the wall time. The output hash must not change.
Activity
perf: write over public/
perf: gc before page writes
perf: write over public/
perf: gc before page writes