Repository navigation
v0.2.3
GoRapide v0.2.3.
Performance fix on the query path: EventsByName (and the observation-view
path it shares with ObservationViews / AddObservationWithTimings) was
rewritten in v0.2.0 to test observation names by cloning and sorting every
observation of every scanned event, matching or not, then building each
returned view through a clone helper that computed a full Params /
Observations copy it immediately discarded and recomputed.
- A new unexported
(*Event).observationsNamedscans stored observations
directly with no copying or sorting; only actual matches reacheventView. eventViewbuilds the view directly instead of routing through
cloneEvent, and no longer deep-copies the matched observation'sParams
map twice.- Which
(event, observation)pairs match, their values, and their sort order
are unchanged. Pinned byTestEventsByNameContract.
Two disclosed aliasing changes — read these before upgrading if you mutate
returned events:
- Within one returned view,
view.Paramsand the matched
view.Observations[i].Paramsare now the same map object rather than two
independent copies. Confined to that one returned view; it never reaches the
poset's stored state or any other view. - A legacy (non-deterministic) event matched via its own primary
Name/Source role now returns the shared, frozen stored*Eventpointer
instead of a cloned view — the same aliasing normEvent()andEvents()
already use. Callers must not mutate such a match. Secondary observation
roles and all matches on deterministic events are unchanged and still return
isolated, defensively-copied views.
Measured on an Apple M3, no -race; B/op and allocs/op were exactly
reproducible and are the reliable signal (ns/op was noisy):
BenchmarkEventsByName: ~2.50MB/op and 23,261 allocs/op ->
164,528 B/op and 1,511 allocs/op.BenchmarkEventsByNameLegacyPrimary: 244,528 B/op and 1,761 allocs/op ->
16,528 B/op and 261 allocs/op (~93% fewer bytes, ~85% fewer allocations).
Full details in CHANGELOG.md.