- Skip recording event history (snapshots of all frontend models + the
backend model per event) when tests run via toTest, toSnapshots,
startHeadless, or the viewer's run-all pass, since history is only
read by the interactive test viewer. This makes memory use flat
instead of growing linearly with simulated time.
- Skip storing pending effects when a command is Command.none, and
check pending effects with Array.isEmpty instead of folding over
every entry each simulation step.
- Find the earliest timer end time with a direct fold instead of
allocating intermediate lists on every animation frame step.
Benchmark (1 simulated hour, 100ms frontend timer + 1s backend timer +
600 network roundtrips): heap 67MB -> 9MB, wall time 1.92s -> 1.71s.
Test pass/fail results and failure messages are unchanged.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XHzxkUaYwwvczLWDasAcL