Repository navigation
Commit 6f97bae
docs(phase4): T9 measured — the store fits, but sending the first tree costs +680 MB (Node) and +325–410 MB (Electron); T9b and T9c come before T10 (Phase 4 T9)
The record: bench/baselines/memory-path/darwin-arm64.json.
- Command: npm run bench -- memory-path --runtime=both
--sizes=1m,2m,3m,5m --corpus=enum1m --candidates=1m,5m --record.
- Harness: 1e05b05; machine: an 8-core M3 with 16 GB; tree clean.
- Each measurement is a fresh process running the app's code compiled
as it ships, with the server's modules loaded, in plain Node 24.16
and in the installed app's Electron 31.7.7 run as Node.
What it says (MB of 2^20 bytes):
- B0 = 132 MB. E0 = 107 MB run as Node: a lower bound for the app's
main process, which also runs Chromium's browser side (plan §S.11
Q16).
- The store costs 70.7 B a row in Node and 72.8 B in Electron (18-byte
names), not the 64 B budgeted. The walk's own working memory is about
10 MB.
- Electron's hand-over copies on the JavaScript thread: 7.3 / 13.6 /
22.8 / 32.6 ms at 1M / 2M / 3M / 5M (R92). One column is in transit
at the peak, the names: 93 MB at 5M. Plain Node copies nothing.
- Node's passes cost 0.53–0.56 µs a candidate. Worker threads load the
addon in both runtimes.
- Sending the first tree (250,000 nodes, 81–86 MB of JSON: every node
carries its full path) costs +680 MB in Node and +325–410 MB in
Electron, against the 150 MB budgeted. A scratch breakdown at 1M:
- the pruned objects: +258 / +96 MB;
- JSON.stringify's one string: +340 / +223 MB;
- the socket's UTF-8 copy: +84 / +86 MB.
- The peaks at 1M / 2M / 3M / 5M: Node 890 / 979 / 1,029 / 1,156 MB;
Electron 621 / 688 / 750 / 878 MB.
The gate. 5M passes 700 MB in both runtimes, and the cause is the
transport, which does not grow with the scan. Lowering T_mem cannot meet
the ceiling in Node at any size, and would cut Electron to 2M for a cost
that does not depend on it. The decision (engineering; the owner may
overrule, §S.11 Q17):
- T_mem stays at the provisional 5M;
- T9b (the first tree sent from the store in chunks, byte for byte
today's) and T9c (Electron's hand-over off the JavaScript thread)
come before T10;
- after them the harness measures again and sets T_mem per runtime
(T10's first step).
M_agg by §S.1.4 is 154 MB (Node, 2.28M rows) and 179 MB (Electron,
2.58M rows) at the measured bytes a row; aggregate also waits for T9b.
Documents:
- the plan: T9 [x] with this record; T9b, T9c; T10's first step; §S.3's
constants; Q16 and Q17;
- DESIGN §7: the measured table;
- RISKS: R92 measured, R74 updated, and R93 new (HIGH).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent b614aa6 commit 6f97bae
4 files changed
Lines changed: 1177 additions & 8 deletions
File tree
- bench/baselines/memory-path
- docs
- engine
- superpowers/plans
0 commit comments