README loads slowly again: the earlier hl:web fix was never deployed
opened by Atlas · assigned to Atlas
opened · updated
Creator: "also loading the readme takes forever, thats already been fixed. now its back. this should take milliseconds, whats going on here?"
Findings (Atlas worker RD, 2026-10-24, diagnosis only, nothing changed):
- Measured live: the mpackdb README sends its first byte after 0.26 to 0.41 s and the text is visible in Chrome after 0.3 to 0.65 s (1280 and 390 px). Clicking the Readme tab takes 0.25 to 0.7 s, once 6.6 s under heavy machine load. The long antcolony README takes 1.2 to 1.8 s, nearly all of it on the server.
- Live code equals main b279f53, so the compact blocks (B1) and the README cache (G3) are deployed. But the vendored Hybriel is 5406d146 from 22 Oct 12:03, and the hl:web fix for slow README tabs (076081bb, 22 Oct 18:20) is not in it. That fix was never deployed, which is why it feels as if it came back.
- Proposed fix, not done: (1) re-vendor gitoria to current Hybriel master to get that fix, expected long README 1.2 s to about 0.5 s; (2) Arachne removes the repeated copies of the Markdown blocks in hl:web, another 100 to 200 ms; (3) gitoria caches the finished README HTML per text so a repeat view needs under 50 ms.
- Not covered: the signed-in view, and a server-side profile. Report: /media/STORAGE/claude-scratch/atlas/RD/REPORT.md
Blocked by
done hybriel #374Live gitoria RSS grows about 11 MB/h while its reachable GC heap stays near 40 MB
History
Atlas opened the ticket 3 comments
Atlas assigned the ticket to Caramboleyo Atlas changed the state review 1 comment
Atlas edited
Edited once
This is not done yet, so I moved it back to progress. Big READMEs are now clearly faster (antcolony about 0.42 s down to 0.32 s live), and a repeat view no longer reads the README from git again. But you asked for milliseconds, and we are not there. The time left is the framework rebuilding the whole page on every request, even for a repo without a README. Arachne gets the next step: serve the finished page from a cache without rebuilding it. Then a worker brings it to gitoria and measures again.
Atlas changed the state progress 4 comments
Atlas Atlas edited
Edited once
Your ruling, via Apollo: keeping the render cache and the page cache for speed is fraud, because a cached server rebuild hides the concept violation. So the plan changes. Arachne removes both caches after her concept fixes. gitoria is then measured without any cache. If the first load is slow, it gets fixed by sending less, not by caching. The gitoria code that uses the caches (the README cache per commit and the page key) comes out with that change. This ticket stays in progress until gitoria is fast without them.
Atlas edited
Edited once
The leftover cache code is removed from gitoria (live commit a487248, deployed with the standby hand-over, 574 checks of / and /api/repos during the deploy were all 200). What was removed, one line each: - lib/pagekey.hl and the pageKey on the / route: a page-build cache (the finished Readme page was served again for the same repository commit). - cacheKey = textHash in the Markdown component and the textHash binding in the readme page: a page-build cache (hl:web built the Markdown component once per key). - The finished-homepage cache per commit in lib/homepage.hl: a value cache (the result of git ls-tree, cat-file and the Markdown parse). - The parsed-blocks cache in lib/markdown.hl: a value cache (Markdown text to blocks, keyed by the text hash). - tests/readme-cache.mjs and its line in deploy.sh: it only tested those caches. README, STATUS and the G25b report now say they were removed and why. The last two were not on the list, but they are the same kind of cache, and without removing them the numbers below would not be cache-free. Gates on the cache-free code: check-theme 49 files 0 problems, signin-return 3/0, browser 261/0, security 70/0 (and again inside deploy-init). Timings, curl first byte, five requests each, no caches. Local = a copy of live storage: main page 0.003 to 0.005 s; antcolony 0.16 to 0.19 s (1.26 MB); mpackdb 0.03 to 0.06 s (215 KB); ident 0.08 to 0.10 s (640 KB). Where the time goes locally on antcolony: the page shell about 0.008 s, the code page with branch and file list 0.02 to 0.04 s, and the Readme render about 0.15 s, so the Markdown render is almost all of it. Live before the change (with caches): main 0.10 to 0.31 s, antcolony 5.9 s first and then 0.12 to 0.70 s, mpackdb 0.11 to 0.47 s, ident 0.11 to 0.48 s. Live after: main 0.10 to 0.13 s, antcolony 0.39 to 0.62 s, mpackdb 0.29 to 0.40 s, ident 0.24 to 0.72 s. So on live the big README pages are slower than the cached best case of about 0.12 s, which is the honest cost; the live machine is also slower than my local copy. Ship less (proposals only, nothing implemented): (1) Almost half of every Readme page is the same Markdown sent twice, once as HTML and once as hydration data (antcolony 560 KB of 1.26 MB, ident 310 KB of 640 KB, mpackdb 124 KB of 215 KB). Render the Readme on the server only, without sending its blocks as data. (2) Show the first part of a long Readme (for example the first 40 blocks, antcolony has 1954 code spans) and load the rest on request. (3) antcolony and ident could start with the Readme headings and the first sections only. (4) The code page already costs little; the branch list is not the problem. This ticket stays in progress.
Atlas edited
Edited once
Two of the value caches that the first cleanup removed are back in gitoria (live commit 90b4f72, deployed through deploy-init with the standby hand-over, 436 checks of / and /api/repos during the deploy were all 200). Apollo's rule: a cache keyed by an immutable commit or content hash may stay, but only if it stores data and never rendered HTML or page output. I read both before restoring them, and neither stores HTML or page output. Back, one line each: - Homepage cache (lib/homepage.hl): it stores the homepage result, which is the list of files with path, whether it is in the docs folder, the sha256 of the text and the parsed Markdown blocks (plain data). Its key is the repository slug plus the commit id of the main branch, so a push is a new key. It stays because the key is an immutable commit id and the value is data only; it is bounded (64 entries, 8 million characters, least recently used leaves first). - Parsed-blocks cache (lib/markdown.hl): it stores the parsed Markdown blocks (plain data, the Markdown component turns them into elements on every request). Its key is the sha256 of the text. It stays because the key is a content hash and the value is data only; it is bounded (32 texts, 4 million characters, least recently used leaves first). Stay removed, one line each: - The page key on the / route (lib/pagekey.hl, pageKey): it made the framework serve the finished Readme page again, so it cached page output. - The framework readme key (readmeKey in lib/pagekey.hl): the function that built that page key, so it goes with it. - The cache key textHash on the Markdown component (cacheKey = textHash): it made the framework keep the built component, so it cached rendered output. Also still gone: tests/readme-cache.mjs, which only tested the removed page key. I also deleted the two leftover files lib/pagekey.hl and tests/readme-cache.mjs from the server, which the deploy copy does not remove. Gates on the restored code: check-theme 49 files 0 problems, signin-return 3/0, browser 261/0, security 70/0 (and again inside deploy-init). Live timings after the restore, first byte in seconds, five requests each (the first request of each page is cold for the restored caches): - main page: 0.31, 0.27, 0.26, 0.25, 0.10 - antcolony: 0.63, 0.47, 0.47, 0.36, 0.32 - mpackdb: 0.32, 0.39, 0.30, 0.13, 0.24 - ident: 0.47, 0.52, 0.20, 0.36, 0.22 For comparison, the cache-free live numbers from the first cleanup were: main 0.10 to 0.13, antcolony 0.39 to 0.62, mpackdb 0.29 to 0.40, ident 0.24 to 0.72. The machine was busier during this run, so the gain from the two data caches is small on these samples; the larger pages stay dominated by the Markdown render, as the earlier ship-less proposals said. This ticket stays in progress.
Atlas unassigned the ticket (was Caramboleyo) Atlas assigned the ticket to Atlas 13 comments
Gitoria Caramboleyo Caramboleyo Gitoria Gitoria Caramboleyo Caramboleyo Caramboleyo Gitoria Caramboleyo Gitoria Caramboleyo Gitoria
Gitoria marked it blocked by hybriel #374 3 comments
Gitoria Gitoria Gitoria
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.
Write…
Write…
edited
Edited once
Write…