RRStack includes micro‑benchmarks (vitest bench) to spot‑check hot paths and validate performance characteristics across scenarios.
npm run bench
Vitest reports ops/second (hz), mean, and relative margin of error (rme). Treat bench outputs as comparative within the same environment. Expect variance across CI and developer machines.
Core flows
getEffectiveBounds across representative shapes:
isActiveAt samples across a daygetSegments/classifyRange over small windowsMutators
toJsonThe React benches run under happy‑dom and wrap operations in React.act(...) for deterministic timing.
hz — higher is faster; compare within the same machine/session.mean — average per‑iteration time; use rme to gauge stability.isActiveAt is very fast; operations are local and avoid far‑future scans.getEffectiveBounds varies by shape; open‑ended detection is O(1), while finite windows may use local sweeps to find the latest active end without scanning far future.getSegments is streaming and memory‑bounded; longer windows with overlapping rules yield more boundary events.{ limit } to getSegments to cap enumeration explicitly (throws if exceeded).