navid/veins / 685e42af51e0b5ceeffb53e1e13fb172cbc05ca40de2b13cb92e0e75a7eb573b / xveins/BENCH_SPECTRE.md
BENCH_SPECTRE.md
← xveins · 2856 bytes · raw · download · view source
veins C++ spectre benchmark
Generated 2026-11-28 16:37:48 UTC by bench/spectre_bench.py.
Environment
| Binary | Version | Path |
|---|---|---|
| Baseline | veins v0.0.1 (veins-store 1) |
/tmp/opencode/veins-clang-build/vn |
| Optimized | veins v0.0.1 (veins-store 1) |
/home/navid/Desktop/projects/veins2/xveins/build/vn |
host: Linux x86_64
cpu: AMD Ryzen 5 5600 6-Core Processor
repeats: 7 (median reported)
inner runs: 5 per command per repeat
repository: /home/navid/Desktop/projects/spectre2
commits: 2601
pack bytes: 576.3 MiB
Workload
- Read-only commands run against an existing veins repository with a large pack.
- Each cell is the median of the per-repeat command medians.
- Progress output is disabled; both binaries write to a pipe.
- Baseline and optimized outputs are compared byte-for-byte before timing.
Results
| Metric | Baseline | Optimized | Speedup |
|---|---|---|---|
| Log [ms] | 146.4 (143.4-152.0) | 24.3 (23.9-25.1) | 6.01x |
| Log -l 1 [ms] | 145.1 (143.5-148.5) | 24.1 (23.8-25.3) | 6.03x |
| Log -l 1000 [ms] | 160.3 (157.7-162.2) | 55.0 (52.7-55.7) | 2.91x |
| Status [ms] | 169.1 (165.2-172.0) | 55.8 (55.0-57.0) | 3.03x |
| Show [ms] | 20.0 (19.5-21.0) | 17.9 (17.7-21.9) | 1.12x |
Each cell is the median with the observed min-max range in parentheses. A speedup above 1 means the optimized binary was faster.
Git reference
Timed against /home/navid/Desktop/projects/spectre with the same machine and warm cache.
| Command | Median |
|---|---|
git log -n 20 |
2.8 ms |
git log -n 1 |
2.9 ms |
git log -n 1000 |
13.4 ms |
git log (all) |
20.4 ms |
Notes
- Pack reads keep one file descriptor per pack and use positional reads. The baseline reopened and seeked the pack for every record header and body.
- Log no longer computes conflict state for commits outside the requested window, and divergence detection is linear instead of quadratic.
git log -n Ntruncates by date after reading N commits.vn logstill walks the full reachable graph so every child is printed before its parents; compare it with fullgit lograther thangit log -n 20.- Git import, git materialize, cloning, and push report progress on stderr when stderr is a terminal. Progress output is suppressed for pipes, so the timings above are unaffected by it.
- Git import is dominated by copying the mirror and reading git objects, not by veins pack lookups. It is not part of this optimization; enable it with
--import-repeats Nwhen you want a rough import timing. - This is a single-machine run. Treat differences below roughly 5% as noise.
Reproduce
cmake --build build -j
python3 bench/spectre_bench.py \
--baseline /path/to/pre-optimization/vn \
--repo /path/to/spectre2 \
--markdown-out BENCH_SPECTRE.md