Why (Daniel, 2026-10-14): a document of benchmarking tasks for Moonkale, covering performance on CPU and GPU, memory consumption, internet usage and load balancing. What lives in memory and what goes to the database is decided beside it, in ADR-0026 Memory and the store.

Today: benchmarks exist, but scattered:

  • bench.mjs (layout step time, 1 k to 100 k nodes);
  • bench-draw.mjs (draw time per frame, SwiftShader);
  • spec 018’s 3 MB typing latency (87 ms per key);
  • the code editor’s 60 FPS gate (CED-R22, Rust Code Editor Roadmap);
  • ratio bounds inside live-preview-long.mjs;
  • the 50 000-row scroll in table-grid.mjs.

None of them keeps its results over time. This page turns them into one catalogue, BM-nn.

Method

  • The reference machine is the development box: 8 cores, 30 GB RAM, an RTX 3080 (10 GB), NVMe, Linux on Wayland. Plus the phone (Galaxy S10e) for mobile budgets, and CI runners only for coarse regressions (they’re noisy and have no GPU).
  • A quiet machine. A benchmark takes the bench lock (flock ~/.cache/moonkale-slots/bench.lock, beside the build slots so a sandboxed agent that may write that one directory can take it) and refuses to run while builds or other agents’ browser suites are running (see Running Several Agents). Numbers from a busy machine are not recorded.
  • Medians over runs: a warm-up first, then N runs (N ≥ 5), recording median, p95 and max. Frame metrics use requestAnimationFrame intervals, latency uses performance.now() around the action, and memory uses RSS (native) and performance.measureUserAgentSpecificMemory (web, where available).
  • Results are kept in a database, not in logs: each run appends a row (benchmark, commit, platform, metric, value, timestamp) to ~/.cache/moonkale-bench/results.sqlite. Moonkale opens that file as a source, so the history is a table and, with the plot extension, a chart (Plotting Requirements). A release’s summary row goes into this page.
  • Budgets: a benchmark with a budget fails when over it. Where none is set, the first job is a baseline; the budget follows from it and from use.

The catalogue

CPU and latency

BMWhatFixtureMetricBudgetExists
01Startup, desktopthe release app, the Default session with this repositoryto first paint; to interactive (a keystroke lands)baseline first—
02Startup, webthe web build, cold cache and warmthe same, plus bytes loaded (BM-30)baseline first—
03Open a folder and index itthis repository; a synthetic 100 k-file tree; a drive root (P-195)time to the first tree listing; time to the index’s end; files per secondfirst listing < 200 ms—
04Typing in a large documentspec 018’s 3 MB file, CodeMirror and the Rust editorkey to dirty state; key to frame87 ms per key recorded; CED-R22 below✅ (spec 018)
05Searchthe index of this repositoryquery to first results (BM25; hybrid with embeddings)< 100 ms BM25—
06Table operationsa 50 000-row resultsort, filter, scroll to the endsort < 100 ms; scroll frames belowpartly (table-grid.mjs times scroll)
07Flow validate and generatea 1 000-block flow, a nested subsystem, the RxInfer coinvalidate time; codegen time< 50 ms for 1 000 blocks—
08Markdown rendera 229 KB note (live preview), a note with 500 formulasparse; render; math (KaTeX and Typst, WP-36)—partly (live-preview-long.mjs)
09Graph layout1 k, 10 k, 50 k, 100 k nodesms per layout step—✅ bench.mjs

GPU and frame time

BMWhatFixtureMetricBudgetExists
10Code editor frames (CED-R22)an ordinary file and the 3 MB one: typing, held arrows, scrolling, selection dragp95 and max frame intervalp95 ≤ 16.7 ms, max ≤ 50 msplanned (WP-01)
11Graph draw100 k and 1 M nodes (coarse tier), idle, panning, hoveringdraw ms per frame; frames per second60 FPS at 100 k on the RTX 3080✅ bench-draw.mjs (SwiftShader only)
12Graph on the phone10 k nodes on the S10eFPS while panning and pinching30 FPS—
13Flow canvas1 000 symbol blocks with captions, panning and draggingframe interval (the overlay’s 2D strokes are on the CPU)p95 ≤ 16.7 ms—
14Table scroll50 000 rows × 60 columnsframe interval while scrollingp95 ≤ 16.7 ms—
15Live run drawinga Lenticulum or RxInfer run streaming 10 k belief updates per second (LT-10)frames per second; update lag60 FPS, lag < 100 ms—

Memory

BMWhatFixtureMetricBudget
20Idlethe desktop app with the Default session; the server with no clientRSSbaseline first
21Per folderthe index per 10 k filesbytes per file in the index—
22Per graph nodethe engine at 100 k and 1 M nodesbytes per node, CPU and GPU side—
23Per table row50 000 rowsbytes per row (Value)—
24The web clientthe wasm heap after opening this repository and the graphbytes—
25No growthopen and close a folder, a graph, a table, a conversation 50 timesRSS after the 50th minus after the 1st≈ 0 (no leak)
26The phonethe release APK with a vaultRSS; whether Android kills it in the backgroundunder the S10e’s per-app limit

Network

BMWhatFixtureMetricBudget
30First loadthe web client, coldbytes transferred, compressed (wasm, JS bundles, fonts, KaTeX)baseline first, then a budget per bundle
31Per keystroketyping in a remote document (spec 018’s splices)bytes per key up and downsplices only, never the document
32Idlean open session doing nothing for 10 minutesbytes per minute (presence, changes_since long polls, keep-alives)—
33Graph and table syncopening the graph of this repository; a 50 000-row resultbytes per sync—
34Agent turnsone conversation turn with toolstokens in and out, bytes, cost; shown to the user per conversation—
35External dataa day of futures from Databento (Trading with Databento); a cached repeatbytes, cost; the repeat costs nothingcached repeat = 0
36Bad networks3G-like latency and 1 % loss (throttled in Playwright), and offlinedoes the UI stay responsive; does it recoverno frozen frame

Storage I/O

BMWhatMetric
40State store writes: settings, layout, an unsaved-buffer snapshot, an entity-log eventlatency median and p95; never on the input path
41Session switch (ADR-0025 Sessions are the outermost state)save and restore time for a session with 20 documents
42Cachessize growth per day of use; eviction keeps them under budget

Load on a shared server

BMWhatFixtureMetric
50Many clients1, 10, 50 simulated web clients on one server: browse, edit, querylatency p95 per action; CPU and memory per client
51Many agents1, 5, 20 conversations running turns with toolsturn latency; how fairly they share CPU and the provider’s rate limit
52Tools beside peoplean index rebuild and a compile during editingthe editing client’s latency stays within its budget (SW-45: humans first)
53Backpressuremore requests than the server can servequeues are bounded; excess is refused with a clear error, never a hang
54Reader modeanonymous visitors querying a published source (Publishing Sources)caps hold (rows, bytes, time); one visitor can’t starve others

Order (proposal)

  1. The method first: the bench lock, the results database, and a runner that records.
  2. Move the existing benchmarks into it: BM-04, 09, 11, and the scroll part of BM-06.
  3. The frame gates: BM-10 (codex’s WP-01), BM-11 on the real GPU, BM-13 and BM-14.
  4. No growth: BM-25 catches leaks early and cheaply.
  5. Network on the web build: BM-30 to 32.
  6. Server load: BM-50 to 54, before a shared server is offered to anyone.

Work package: WP-55 in Work Packages.

WP-69 development profiles — 2026-10-17

Development builds optimize the Tree-sitter runtime and dioxus-code syntax-query dependency at level 2, and the code-view crate at level 1. The standalone native fixture mirrors these overrides because it has its own workspace. This is a developer-experience change: parsing and preview indexing remain responsive while exercising ordinary development builds. It trades some compilation time and precise debug stepping for faster input-path work. Release and graph-wasm profiles are unchanged.

These overrides are a separate proposal from the code fix in P-211 Preview row queries and folding repeated full text work. Validate live-preview-long with the code changes and the original development profile first; record the same code with these overrides separately. A compiler-profile improvement must not stand in for fixing repeated document scans or parsing. The per-run medians, p95s, build variants and retained logs are in the WP-69 handoff and commit requests.

On the final WP-69 code, the fresh-fixture Firefox run measured Preview median/p95 82.84/86.14 ms against Source 72.92/76.20 ms with the original profile. With the overrides, the same suite measured 73.38/77.76 ms against 68.70/70.66 ms. Both pass the unchanged bound; the overrides are retained solely as a separate development-experience improvement. These are local development-build results, not release or physical-device acceptance.