From 0f99ed43f15aba7805ebe6d757a2d98418596205 Mon Sep 17 00:00:00 2001 From: Jade Lovelace Date: Thu, 30 May 2024 13:44:01 -0700 Subject: build-time: remove 20% more by PCH'ing C++ stdlib It seems like someone implemented precompiled headers a long time ago and then it never got ported to meson or maybe didn't work at all. This is, however, blessedly easy to simply implement. I went looking for `#define` that could affect the result of precompiling the headers, and as far as I can tell we aren't doing any of that, so this should truly just be free build time savings. Previous state: Compilation (551 times): Parsing (frontend): 1302.1 s Codegen & opts (backend): 956.3 s New state: **** Time summary: Compilation (567 times): Parsing (frontend): 1123.0 s Codegen & opts (backend): 1078.1 s I wonder if the "regression" in codegen time is just doing the PCH operation a few times, because meson does it per-target. Change-Id: I664366b8069bab4851308b3a7571bea97ac64022 --- tests/unit/meson.build | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/unit/meson.build b/tests/unit/meson.build index 35a11a5d3..d8d4a00d1 100644 --- a/tests/unit/meson.build +++ b/tests/unit/meson.build @@ -68,6 +68,7 @@ libutil_tester = executable( liblixutil_test_support, nlohmann_json, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( @@ -102,6 +103,7 @@ libstore_test_support = library( include_directories : include_directories( 'libstore-support', ), + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) liblixstore_test_support = declare_dependency( include_directories : include_directories('libstore-support'), @@ -135,6 +137,7 @@ libstore_tester = executable( gtest, nlohmann_json, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( @@ -166,6 +169,7 @@ libexpr_test_support = library( include_directories : include_directories( 'libexpr-support', ), + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) liblixexpr_test_support = declare_dependency( include_directories : include_directories('libexpr-support'), @@ -199,6 +203,7 @@ libexpr_tester = executable( gtest, nlohmann_json, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( @@ -225,6 +230,7 @@ libcmd_tester = executable( gtest, boost, ], + cpp_pch : ['../../src/pch/precompiled-headers.hh'], ) test( -- cgit v1.2.3