Usage history reader: final measurements

PR #36009 · head 32984e99 · 13 November 2026

Reusing one 256 KiB buffer per plain transcript reduces CPU work. Retained line fragments are copied before reuse. Compressed transcripts keep their existing stream.

Confirmed: less CPU work

Ten paired rounds on one clean large VM. Baseline normalized to 100; changes are the benchmark’s paired estimates.

CPU cycles · 17% fewer
Before
100
After
83
Instructions · 11.4% fewer
Before
100
After
88.6

The middle half of paired cycle changes was −20.8% to −14.7%; instructions −11.9% to −10.2%. Counters cover the whole command, including three Vitest startups.

No proven elapsed-time improvement. The paired wall estimate was −4.6%, below the benchmark’s 10% noise floor.

Per-read medians, descriptive

PhaseElapsed before → afterCPU before → afterRSS before → after
Cold first3467 → 3139 ms10048 → 6817 ms621 → 574 MB
Unchanged warm102 → 106 ms168 → 177 ms631 → 584 MB
Persisted restart165 → 171 ms335 → 344 ms459 → 459 MB
Append first234 → 208 ms569 → 389 ms480 → 462 MB

These phase medians describe captured samples, not separate validated elapsed-time speedups. CPU time sums across threads. RSS is sampled process memory, not peak RSS.

Method and correctness

Product base 43ce39595b, candidate 32984e99, both with identical benchmark kit. Deterministic content-free corpus: about 3.2 GB, 1,412 in-window generated files plus 311 older files. Append grows 50 files per provider by 64 KiB. The same unchanged and appended summary fingerprints matched on both versions. Four focused suites passed all 109 tests; CI is green. All three council reviewers scored 9/10 and the final proof audit found no code/proof gaps.

The unchanged kit previously passed a base/base self-check. The final comparison used fleet-boat-bench run --type large --prepare 'bash .bench/usage/phase.sh prepare' refs/usage-bench/harness-base-rebased refs/usage-bench/harness-head-rebased -- 'bash .bench/usage/phase.sh all'. Full phase logs were copied before VM deletion: 67 baseline rows and 73 candidate rows. Harness commits and raw logs remain local; they are not shipped product files.

Limits

Performance for 256 KiB–8 MiB fragmented lines, tiny appended tails, GC event counts, and network-mounted storage was not measured. The VM used local disk. No WAN, reduced byte-volume, compressed-reader speedup, or general loading-time speedup is claimed. Existing tests cover correctness across chunk boundaries, streaming transitions, UTF-8/CRLF tails, append/rewrite guards, compressed decoding and failures.

PostPlan uses true-black fallback colors because the active client theme could not be read.