Skip to content

Benchmarks ​

Small check: under synthetic bursts faster than the demo simulator (~0.5 evt/s), the capped ring still stops at MAX_EVENTS (10 000).

What this is (and is not) ​

npm run bench runs runAppendBenchmark in Node / Vitest.

It checksIt does not claim
Buffer length stays ≤ 10 000 after burstsBrowser FPS or React commit cost
Append path stays usable for synthetic 100 / 500 / 1000 evt/s payloadsProduction load or multi-tab stress
Approx byte estimate is a rough lower boundAccurate heap profiling

Treat this as a performance consideration for the data structure — not a scalability guarantee.

How to run ​

bash
npm run bench

Representative results ​

Run on a developer machine while writing this page. Absolute timings vary; the useful invariant is final buffer length ≤ 10 000.

Target evt/sEvents in the 1s windowFinal buffer lengthCap
100100≤ 10 00010 000
500500≤ 10 00010 000
10001000≤ 10 00010 000

Why these numbers matter for the UI ​

  • The ring overwrites oldest events when full — history is bounded on purpose.
  • The worker only receives a short sample window, not the whole buffer.
  • appendEvents exists so tests can publish batches without one React snapshot per event.

More on the buffer: Decisions & challenges · Pipeline