Repository navigation
v0.2.2
GoRapide v0.2.2.
Performance fix on the causal-insert path: v0.2.0's timing-closure validation
on AddEventWithCause and addCausalLocked rode helpers that scanned the
entire event store per call, turning insertion of a long causal chain into
O(n^2) work even when no event in the poset carried any EventTiming.
AddEventWithCauseskips predecessor collection and the conflict check
entirely when the incoming event carries no timing.addCausalLockedtracks a poset-wide count of stored occurrences carrying a
Rapide interval and skips the O(closure) timing-closure scan while it is
zero. The count is kept exact through a single storage chokepoint used by
every path that writes an occurrence into the store, including
AddObservationWithTimingsandPoset.UnmarshalJSON.- Behavior for any poset containing at least one timing is unchanged:
validation still runs the full closure scan exactly as before.
Measured on an Apple M3, no -race — BenchmarkLinearChainInsertUntimed
(1,000-event untimed linear chain): ~17.8-20.6s per chain build ->
~46-49ms, roughly 380-440x faster, scaling close to linearly instead of
quadratically in chain length.
Full details in CHANGELOG.md.