1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

libstore-tests: Improve compile times with PCH

(Before)

**** Time summary:
Compilation (25 times):
  Parsing (frontend):          145.5 s
  Codegen & opts (backend):     65.9 s

(After)

**** Time summary:
Compilation (26 times):
  Parsing (frontend):           39.9 s
  Codegen & opts (backend):     55.1 s
This commit is contained in:
Sergei Zimmerman 2025-08-17 01:08:31 +03:00
parent 347ed8d9ba
commit 8be1cc6e96
No known key found for this signature in database
2 changed files with 11 additions and 0 deletions

View file

@ -94,6 +94,7 @@ this_exe = executable(
link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest
install : true,
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
)
test(
@ -127,6 +128,7 @@ if get_option('benchmarks')
include_directories : include_dirs,
link_args : linker_export_flags,
install : true,
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
cpp_args : [
'-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"',
],

View file

@ -0,0 +1,9 @@
#include "nix/store/store-api.hh"
#include "nix/store/tests/libstore.hh"
#include "nix/util/util.hh"
#include <gtest/gtest.h>
#include <nlohmann/json.hpp>
#include <rapidcheck/gtest.h>
#include <regex>