Latest Results
perf: Periodic Checkpointing, etc. (#275)
Cut the realtime pipeline's per-event cost roughly in half and remove
every durable hop from the solve path.
> One node (16CPU, 32GB) now sustains ~21k events/s, about 1.4k events/s
per vCPU.
- **Transient solves.** Solve requests and results use Core NATS
request/reply instead of durable job and result streams; the
unacknowledged raw event is the retry source.
- **Sticky matchers.** Each matcher caches it's trip results.
- **Hash once.** Matchers digest each trip once, and results carry the
digest, so the owner never re-serialises a trip.
- **Commit modes.**
- `direct` publishes outputs, then compare-and-sets the checkpoint in
one script.
- `deferred` persists each vehicle every `--checkpoint-every` commits or
`--checkpoint-interval`, in the background. The frontier advances only
over events a persisted checkpoint covers, so recovery replays and
re-solves deterministically.
- **Ownership fencing.** Recovery takes a per-partition epoch. Frontier
writes double as a one-second heartbeat, and a superseded owner's writes
are refused, so it stops its partition.
- **One-round-trip view writes.** The materializer caches per-vehicle
revisions and uses a per-segment `max_ts` bound to apply most outputs
without a read.
- **Dedicated solve pool.** Solves run on a rayon pool sized to
`--solve-slots`, instead of blocking threads handing each parallel loop
to the global pool. Matcher CPU per event fell ~11%, and locally the
solve itself costs half as much.
- **Tooling and deployment.** `replay --copy-spread` for realistic
per-vehicle cadence, local benchmark scripts, a separate served-view
Valkey, and orchestrator health probes.
## Results
At ~15k/s, ~18k/s and ~21k/s offered load:
| | Before | After |
| --- | ---: | ---: |
| CPU per event | ~0.8 ms | ~0.5 ms |
| Bytes per event | ~7 KB | ~4 KB |
| Checkpoint KV commands per event | ~7.5 | ~1 |
| Sustained on one 15-vCPU node | ~14.5k/s | ~21k/s | Latest Branches
0%
-10%
0%
realtime/realtime-pipeline © 2026 CodSpeed Technology