summaryrefslogtreecommitdiff
path: root/src/content/en/pastebin/2020/12
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2026-09-12 14:15:16 -0300
committerEuAndreh <eu@euandre.org>2026-09-12 14:15:16 -0300
commit8658a4c939b82c38ce8f2d3f890e771ff68cbe3d (patch)
tree4d18a9f0153bb55f8e594a45c54c137c22aba247 /src/content/en/pastebin/2020/12
parentCarry a long-description (diff)
downloadeuandre.org-8658a4c939b82c38ce8f2d3f890e771ff68cbe3d.tar.gz
euandre.org-8658a4c939b82c38ce8f2d3f890e771ff68cbe3d.tar.xz
Compute each selector once, not seven times
mkdeps.sh asked the same questions over and over: "pages" is built on four of the other selectors, the tagged list mkwb reads asks for all seven again, and "collections" alone was computed nine times, a find and a grep and a sort apiece. It spawned 372 processes to print 2450 lines. Every answer is now computed once, up front, into a file named after it, and read back from there. The three hand-rolled caches go with it: they were the same idea, done three times, and the loop that fills them says the dependency order out loud. Two smaller things fell out on the way: collections ran dirname once per collection where sed does it in one, and articles ran one find per collection where find takes them all at once. The order the loop fills them in is not decoration. A pipeline's stages run side by side, and only_masters and with_translations are two stages of one selector that both read what po4a writes --- so an answer computed where it is first needed can be read while it is still half-written, which is a race that shows up as an empty list and a deps.mk missing half the site. Filled in order, up front, nothing is ever read while it is being written. 372 processes to 109, 0.47s to 0.24s, byte-identical deps.mk over a dozen runs. The floor now is exec(2): the tools this reaches for cost 1.1 to 2.5ms each to start, and a hundred of them is the whole of the remaining runtime. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KxLpaNQThKfMG3ecCJptP9
Diffstat (limited to 'src/content/en/pastebin/2020/12')
0 files changed, 0 insertions, 0 deletions