Benchmark methodology¶
Euxis ships two benchmark binaries. Each one answers a different question, and the two together back the public performance numbers in the README.
Binary |
What it measures |
Built when |
|---|---|---|
|
Crypto primitives (AES-GCM throughput, BLAKE2b key derivation), A2A msgpack round-trip |
|
|
The user-visible evidence pipeline: SBOM emission, SCA parsing, DSSE sign/verify, slopsquatting lookup, scan-cache get/put, file hashing |
|
Both binaries emit Google Benchmark JSON (--benchmark_format=json).
That format is consumed directly by bencher.dev,
github-action-benchmark,
and any in-house dashboard that speaks the standard schema.
Why two binaries¶
The crypto primitives turn over in the nanosecond range and need
--benchmark_min_time=0.1s to converge. The scan + evidence
benchmarks turn over in microseconds-to-milliseconds and need
--benchmark_min_time=5s to get tight error bars on the slower
cases (SBOM emission on a 5,000-component document, for example).
Running both at the higher of the two budgets wastes CI time;
running both at the lower of the two undercounts the scan numbers.
Separating them lets each run at its natural pace.
What euxis_scan_gbench covers¶
Benchmark |
Fixture |
Unit |
|---|---|---|
|
Synthetic 5,000-component SbomDocument |
ms |
|
Same fixture |
ms |
|
100 not-affected VEX statements |
µs |
|
1,000 |
ms |
|
1,000 |
ms |
|
Embedded seed corpus |
ns |
|
Minimal in-toto Statement |
µs |
|
Same |
µs |
|
SQLite scan cache, fresh DB |
µs |
|
64 KiB blob (typical source file) |
µs |
All fixtures are built in-process — no on-disk dependencies beyond the temp-file-scoped SQLite cache. This makes runs deterministic and CI-resumable.
What’s deliberately NOT here yet¶
The KPI table in the v0.0.3 implementation plan (an internal document) calls for:
BM_ScanThroughput_C_1M_LOC— synthetic 1M-LOC C sourceBM_ScanRust_TokioRepo— pinned tokio cloneBM_ScanGo_KubernetesSubset— pinned k8s subsetBM_ScanIncremental_OneFileChange— warm-cache delta
These benchmarks measure the work that the SAST engine does, and the SAST engine itself (tree-sitter parser, Code Property Graph, taint analysis) is P1. Adding them now would either measure synthetic work that has no relationship to the real pipeline or require pinning a fixture corpus that drifts between releases.
The scan_bench.cpp suite ships the benchmarks we can run honestly today, with the right shape (Google Benchmark JSON) so they pair-up cleanly with the P1 additions when those land.
Running locally¶
# Configure with the gbench target enabled.
cmake -B cmake-build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DEUXIS_BUILD_GBENCH=ON
# Build only the scan-bench target.
cmake --build cmake-build --parallel --target euxis_scan_gbench
# Run with the same parameters CI uses.
./cmake-build/libs/bench/euxis_scan_gbench \
--benchmark_min_time=5s \
--benchmark_format=json \
--benchmark_out=scan-bench.json \
--benchmark_out_format=json
A human-friendly run is fast:
./cmake-build/libs/bench/euxis_scan_gbench --benchmark_min_time=0.5s
CI integration¶
.github/workflows/bencher.yml runs euxis_scan_gbench on every
push to main and on PRs that touch the relevant library
directories. The JSON output is attached as the
scan-bench-<os> workflow artifact and retained for 90 days.
A follow-up commit will wire the artifact to a real bencher.dev project so trend graphs land on every push automatically; that needs the bencher.dev API token, which lives in repository secrets and is therefore outside the scope of this PR.
Reproducibility¶
Every benchmark in scan_bench.cpp is deterministic:
Synthetic fixtures are built from
std::to_string(i)-style loops, no clocks, nostd::randomseeded fromrandom_device.The DSSE sign benchmark generates a keypair once at fixture setup and reuses it across iterations.
The scan-cache benchmark opens a tempfile-scoped SQLite database per run and cleans it up on exit.
Google Benchmark itself reports the iteration count, mean, median, stddev, and CV per case, so the JSON is enough to detect drift without re-running.
This means you can re-run the bench harness on the same SHA, on the
same host, with the same --benchmark_min_time, and expect numbers
that match to ~1 % CV.
Reading the JSON output¶
Each benchmark produces an entry under benchmarks[] with this
shape (abbreviated):
{
"name": "BM_CycloneDX_Emit_5K",
"iterations": 4321,
"real_time": 1.234,
"cpu_time": 1.220,
"time_unit": "ms",
"items_per_second": 4.06e6,
"bytes_per_second": 0
}
real_timeis what humans care about — wall clock per iteration.cpu_timeshould trackreal_timeclosely for these benchmarks (they’re not I/O-bound except for the file-hash one).items_per_secondis set where the benchmark reports an item count viastate.SetItemsProcessed()— useful for relative comparisons across changes that affect per-component work.bytes_per_secondis set on the SCA parser benchmarks (input bytes consumed per second) and the file-hash benchmark.
The schema is documented exhaustively at https://github.com/google/benchmark/blob/main/docs/user_guide.md.