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

add derivation parser benchmark

the current identified bottlenecks are parseString in derivations.cc and dirOf (because of std::filessystem creation).
This commit is contained in:
Jörg Thalheim 2025-07-29 09:25:29 +02:00
parent 47f5e5fbef
commit 1989dd7bf9
10 changed files with 270 additions and 2 deletions

View file

@ -105,3 +105,19 @@ test(
},
protocol : 'gtest',
)
# Build benchmarks if enabled
if get_option('benchmarks')
gbenchmark = dependency('benchmark', required : true)
benchmark_exe = executable(
'nix-store-benchmarks',
'derivation-parser-bench.cc',
config_priv_h,
dependencies : deps_private_subproject + deps_private + deps_other + [gbenchmark],
include_directories : include_dirs,
link_args: linker_export_flags,
install : false,
cpp_args : ['-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"'],
)
endif