Skip to content

perf: answer pages from memory and revalidate in the background - #2

Merged
capjan merged 1 commit into
mainfrom
feat/performance
Nov 4, 2026
Merged

capjan merged 1 commit into
mainfrom
feat/performance

Conversation

@capjan

@capjan capjan commented Nov 4, 2026

Copy link
Copy Markdown
Owner

Makes Cockpit feel immediate. Pages no longer wait for external processes or the network.

What changes

  • Pages answer from memory: LiveData reads the machine in the background. Each page compares itself once after loading and reloads if something changed outside Cockpit. Every change in Cockpit refreshes the data before its result is shown.
  • Start: the release catalog is stored on disk, so a normal start does not depend on the network. Without a connection, the last known catalog keeps working.
  • Assets: a version in the URL lets the browser cache them for good.
  • NuGet search: asks the API directly and falls back to the CLI. Old results stay visible until new ones arrive, and repeated queries are remembered.
  • Privacy list: Settings now also names azuresearch-usnc.nuget.org, which Cockpit already used.
  • Benchmark: npm --prefix ui run bench measures click and key press to visible result against the native binary.

Results on the native AOT build (median)

Measure Before After
Server response per page 119–131 ms 0–4 ms
Click to new page visible 162–174 ms 35–46 ms
Launch to first page visible 555 ms 179 ms
New NuGet search to result 1,213 ms 436 ms

All 33 measures were within budget on one Mac in headless Chromium.

Trade-off

A page can show a slightly older state for a moment. It corrects itself about 0.4 s after loading, which is visible after changes made outside Cockpit.

Every page used to start external processes and could wait for NuGet and GitHub. Pages
now answer from memory, and each one compares itself afterwards, so an outside change
still appears on its own. Every change refreshes the data before its result is shown.

The release catalog is stored on disk, so a normal start no longer depends on the
network. Assets are cached for good through a version in their URL. NuGet search asks
the API directly and falls back to the CLI, keeps old results until new ones arrive
and remembers repeated queries. The Settings page now also names the NuGet search host
Cockpit already used.

A new benchmark measures click and key press to visible result on the native binary.
@capjan
capjan merged commit ea4bd2b into main Nov 4, 2026
12 checks passed
@capjan
capjan deleted the feat/performance branch November 6, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant