1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-03 07:31:00 +01:00

libstore-tests: Add reference scanning benchmark

This benchmark should provide a relatively realistic
scenario for reference scanning.

As shown by the following results, reference scanning code
is already plenty fast and is definitely not a bottleneck:

```
BM_RefScanSinkRandom/10000               1672 ns         1682 ns       413354 bytes_per_second=5.53691Gi/s
BM_RefScanSinkRandom/100000             11217 ns        11124 ns        64341 bytes_per_second=8.37231Gi/s
BM_RefScanSinkRandom/1000000           205745 ns       204421 ns         3360 bytes_per_second=4.55591Gi/s
BM_RefScanSinkRandom/5000000          1208407 ns      1201046 ns          597 bytes_per_second=3.87713Gi/s
BM_RefScanSinkRandom/10000000         2534397 ns      2523344 ns          273 bytes_per_second=3.69083Gi/s
```

(Measurements on Ryzen 5900X via `nix build --file ci/gha/tests componentTests.nix-store-tests-run -L`)
This commit is contained in:
Sergei Zimmerman 2025-08-04 02:11:14 +03:00
parent 51a32e4645
commit 20df0e5fa7
No known key found for this signature in database
2 changed files with 93 additions and 0 deletions

View file

@ -113,6 +113,7 @@ if get_option('benchmarks')
benchmark_sources = files(
'bench-main.cc',
'derivation-parser-bench.cc',
'ref-scan-bench.cc',
)
benchmark_exe = executable(