OXYGENHUB
◆ api-unknown-fields oxygenhub / docs / performance.md
2.2 KiB · Markdown · last changed Performance notes: cold views after the oxy-core change 1 month ago renderedsource blame history raw

Performance notes

2026-09-28: render and history caches (hub spec §16.3)

Earth, OxygenHub on its own disk, median of seven requests per page with curl, the oxygen repository (about 900 changes). File pages were the slow ones; the raw bytes of the same files took 5 ms, so the time was in rendering and in history, not in reading the state.

PageBeforeRender caches+ last change and blame
oxygen/file/main/docs/spec.md (129 KB of Markdown)196 ms192 ms8 ms
oxygen/file/main/crates/oxy-core/src/repo/mod.rs400 ms205 ms18 ms
oxygen/file/main/crates/oxy-core/src/state.rs (962 lines)317 ms196 ms14 ms
…/state.rs?blame=1428 ms303 ms23 ms
oxygen overview8 ms7 ms7 ms
oxygen/changes/main26 ms27 ms27 ms

What was cached, all in memory, bounded, least recently used first:

  • Rendered Markdown by the text and its two link bases (32 MiB).
  • Highlighted files by file name and text (64 MiB).
  • A file's last change by state and path (4 MiB): it was found with log_for_path_in, which rebuilt the whole state and read every change on each view. It is the biggest single win.
  • Blame by state and path (64 MiB).

A state is content addressed, so none of these can go stale; what can change (bookmark and tag labels on a change) is still worked out on every view. The first view of a file still pays the full cost once.

?plain=1 downloads no longer compute the last change or the sidebar.

2026-09-28: oxy-core history of a loaded state

log_for_path_in and blame_in rebuilt and rendered the whole state on every call, and the log was built twice. oxy-core now has log_of(state), log_for_path_of(state, path, limit) (the path found in the tree alone, stopping at limit) and blame_of(state, tree, path), and the hub passes the state it already holds. First views after a restart (every cache empty, including the state cache):

PageBefore any cacheCold nowWarm
docs/spec.md196 ms146 ms8 ms
crates/oxy-core/src/repo/mod.rs400 ms256 ms17 ms
crates/oxy-core/src/state.rs317 ms121 ms16 ms
…/state.rs?blame=1428 ms88 ms24 ms