skip to content
Mohamed Azahrioui
← work

Performance engineering · 2026

P99KV

A C++20 and Linux performance lab built around an in-memory key-value store. The store is deliberately small. The measurement around it is the point.

Solo · open source, MIT

snapshot
type
Performance engineering
period
2026
source
public github

view repository →

problem

A benchmark that is easy to write is easy to believe. This one prints throughput and per-operation latency from the same workload, and the two disagreed with each other. The project exists to find that kind of thing: to learn what a change actually costs rather than what it ought to cost, and to distrust the instrument before trusting the number.

outcomes

  • A 59% gain in GET throughput from removing an allocating copy, across five interleaved runs at -O2 on a pinned core, with the before and after ranges not overlapping on any run
  • The per-operation latency column was found to be dominated by clock overhead, and is documented as such rather than reported as a result
  • Published with the method, the hardware, the compiler and the commit, so the numbers can be re-run rather than taken on trust

what i built

  • Deterministic workload: 50,000 entries, 32-byte values, 200,000 operations, and a fixed-seed access pattern so every run touches the same keys in the same order
  • Throughput and latency measured in separate loops, with the throughput loop containing no clock calls at all
  • 10,000 untimed warm-up operations before each measurement, and a printed checksum so the optimiser cannot delete the work being measured
  • A separate single-workload binary, so one operation type can be run on its own under perf
  • A build that defaults to -O2 rather than leaving an unoptimised benchmark as the obvious path, and a README that records the conditions behind the published numbers

tech stack

C++20CMakeLinuxperfg++WSL2

Read the source

The repo has the code, structure, and implementation detail.