OXYGENHUB

Performance notes: measurements on Earth before and after the render and history caches 8d194f035eb6

closes #14
Author
Andy McCall @andymccall <[email protected]>
When
· 2026-09-28 14:14 UTC
Signature
✔ signed by Andy McCall
Hash
8d194f035eb693f13c532c13e2651510d8bfd11dfff6d58bf5ec176b2cb2a3d6
Depends on
93be9ce4653e
Depended on by
2d58f17e728b
In bookmarks
api-unknown-fields cancel-landed-runs clear-waiting close-proposal-140 diffusion-pin-bookmark draft-ready image-check job-waits main oh-comment-body-file proposal-list-fast run-one-job wiki-says-so
In tags
v0.1.0 v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.4.1 v0.4.2 v0.5.0 v0.5.1 v0.5.2 v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
Edits
1 atom, 1 tree operation, 1 file

Browse the tree at this change

added docs/performance.md +32 −0
1 +
# Performance notes
2 +
3 +
## 2026-09-28: render and history caches (hub spec §16.3)
4 +
5 +
Earth, OxygenHub on its own disk, median of seven requests per page with
6 +
`curl`, the `oxygen` repository (about 900 changes). File pages were the
7 +
slow ones; the raw bytes of the same files took 5 ms, so the time was in
8 +
rendering and in history, not in reading the state.
9 +
10 +
| Page | Before | Render caches | + last change and blame | 
11 +
|---|---:|---:|---:|
12 +
| `oxygen/file/main/docs/spec.md` (129 KB of Markdown) | 196 ms | 192 ms | 8 ms |
13 +
| `oxygen/file/main/crates/oxy-core/src/repo/mod.rs` | 400 ms | 205 ms | 18 ms |
14 +
| `oxygen/file/main/crates/oxy-core/src/state.rs` (962 lines) | 317 ms | 196 ms | 14 ms |
15 +
| `…/state.rs?blame=1` | 428 ms | 303 ms | 23 ms |
16 +
| `oxygen` overview | 8 ms | 7 ms | 7 ms |
17 +
| `oxygen/changes/main` | 26 ms | 27 ms | 27 ms |
18 +
19 +
What was cached, all in memory, bounded, least recently used first:
20 +
21 +
- Rendered Markdown by the text and its two link bases (32 MiB).
22 +
- Highlighted files by file name and text (64 MiB).
23 +
- A file's last change by state and path (4 MiB): it was found with
24 +
  `log_for_path_in`, which rebuilt the whole state and read every change on
25 +
  each view. It is the biggest single win.
26 +
- Blame by state and path (64 MiB).
27 +
28 +
A state is content addressed, so none of these can go stale; what can
29 +
change (bookmark and tag labels on a change) is still worked out on every
30 +
view. The first view of a file still pays the full cost once.
31 +
32 +
`?plain=1` downloads no longer compute the last change or the sidebar.