Skip to content

Compilation and replay measurements ​

Run bun --conditions=source scripts/benchmark-ui.ts from the repository root. It uses a temporary chat store and a fixture backend, streams about 100 deltas ten milliseconds apart, and removes the store afterward. The output includes compiler timing, synchronous delta handling, timer delay, UI bytes, log bytes and disk-backed replay timing.

The measurements below were taken on macOS arm64 with Bun 1.4.2 on 9 October 2026. Scans and replays each have twenty samples after warmup. Replay reads have a warm filesystem cache. Timer delay measures how late a ten-millisecond timer ran during the fixture session, including ordinary chat processing and disk writes. It does not isolate the compiler's contribution.

InputMedian scan beforeMedian scan after
2,000,000 UTF-16 units of prose3.25 ms1.68 ms
The same prose followed by one UI block3.36 ms1.69 ms
100,000 UI fences, 4,100,000 UTF-16 units19.82 ms0.07 ms

The scanner now visits lines individually and stops when the reply quota refuses further UI. It keeps the same UTF-16 ranges, fence rules and bounded fallback. It does not allocate an array containing every line before enforcing the quota.

Streamed fixture100 stats in one block2,000,000 units of prose and one block
Input bytes3,5572,000,041
UI previews sent51
UI previews stored in the log00
Final UI metadata bytes24,105607
Total log bytes38,4564,207,524
Median synchronous delta time0.04 ms0.50 ms
Final delta time2.21 ms6.12 ms
Maximum timer delay4.16 ms8.15 ms
Median disk-backed replay time0.62 ms3.78 ms

Total log bytes include the original text deltas and the authoritative final text, as well as ordinary chat events. Preview bytes are sent only to attached clients. The fixture checks a single chat; simultaneous chats, cold disk replay and recorded responses from actual Claude and Codex sessions still need acceptance measurements.

Licenses and third-party notices are listed in each package.