The Benchmark Harness and Its Baseline
Three tiers, a fixed seed and a 10% regression gate on p99. The checked-in baseline, engine only: similarity recall at 273 microseconds p50 on 1,000 memories and 330 on 10,000.
273 µsp50 similarity recall, 1K
- 273 / 335 microseconds
- similarity recall p50 / p99 at 1,000 memories
- 330 / 405 microseconds
- the same at 10,000 memories
- 991 microseconds
- remember p50
- 1,021 bytes
- disk per memory at 10,000
A memory engine sits on the hot path of every agent turn, so a latency regression is a product regression. We keep a standalone benchmark binary, hebbs-bench, and a checked-in baseline that release candidates are compared against.
What it measures
Three suites: latency (p50, p95, p99, p99.9 per operation), scalability (recall latency at growing memory counts) and resources (disk and bytes per memory). Three tiers set the size: quick is 10,000 memories with 1,000 runs per operation and 100 warmup runs; standard is 100,000 with 10,000 runs; full is 1,000,000 with 100,000 runs. Datasets are generated from a fixed seed (42 by default) so two runs see the same memories. With --baseline, the report flags any operation whose p99 regressed by more than 10%, and that blocks a release. Benchmarks run on dedicated hardware; shared CI runners are too noisy to compare.
Checked-in baseline (quick tier, Linux x86_64)
| Operation | p50 | p99 |
|---|---|---|
| get | 1 microsecond | 2 microseconds |
| recall, similarity | 273 microseconds | 335 microseconds |
| revise | 537 microseconds | 854 microseconds |
| recall, temporal | 553 microseconds | 606 microseconds |
| remember | 991 microseconds | 1,334 microseconds |
| prime | 1,113 microseconds | 1,204 microseconds |
| count | 3,386 microseconds | 3,606 microseconds |
| forget (single) | 116,470 microseconds | 128,747 microseconds |
From 1,000 to 10,000 memories, similarity p99 moves from 335 to 405 microseconds and temporal p99 from 606 to 733. Disk per memory falls from 1,088 bytes at 1,000 to 1,021 at 10,000.
How to read it
- The latency suite uses a mock embedder, so these numbers are the engine alone: serialization, RocksDB writes, index updates and search. Model inference is extra and is the larger share of a real remember or recall.
- The baseline is the quick tier. It tells us about regressions and the shape of the curve at small scale, and says nothing about a million memories.
- Single forget at 116 ms is two orders of magnitude slower than every other write. The baseline makes that visible.
- count at 3.4 ms is a scan and should not be called per turn.
Where the time goes
A fourth command, degradation-curve, inserts memories and stops at checkpoints (every 50 up to 1,000 by default, 20 probes each) to measure remember and each recall strategy, with deltas against the previous checkpoint. It installs a tracing layer that records the duration of named spans inside the engine, such as remember.embed, remember.hnsw_commit, remember.write_batch, recall.similarity.hnsw_search and recall.merge_and_rank, and can run with the real ONNX model. When p99 drifts, the report names the phase that moved.
