Skip to content

v0.2.2

Choose a tag to compare

@ShaneDolphin ShaneDolphin released this 24 Aug 02:03
· 6 commits to main since this release

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.

  • AddEventWithCause skips predecessor collection and the conflict check
    entirely when the incoming event carries no timing.
  • addCausalLocked tracks 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
    AddObservationWithTimings and Poset.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.