[PATCH 3/7] meson: use precompiled headers for our test-helper
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 24, 2026, 14:09 UTC
- Message-ID
- <20260924-pks-meson-improvements-v1-3-90b7f79f1c4e@pks.im>
- In-Reply-To
- <20260924-pks-meson-improvements-v1-0-90b7f79f1c4e@pks.im>
In 671df48df8 (meson: precompile "git-compat-util.h", 2026-03-19) we have introduced support for precompiled headers into Meson. At that time though we only converted "libgit.a" to make use of those.
Nowadays though, our test-helper also consists of a bunch of code files, and all of these include "git-compat-util.h" via "test-tool.h" as the first header. So they're a natural target to also use precompiled headers.
Adapt the test-tool executable to make use of them, which results in a surprisingly large speedup for clean builds:
Benchmark 1: meson compile (version = HEAD~)
Time (mean ± σ): 6.363 s ± 0.033 s [User: 92.858 s, System: 22.500 s]
Range (min … max): 6.311 s … 6.418 s 10 runs Benchmark 2: meson compile (version = HEAD)
Time (mean ± σ): 5.327 s ± 0.021 s [User: 75.135 s, System: 20.373 s]
Range (min … max): 5.299 s … 5.362 s 10 runs Summary
meson compile (version = HEAD) ran
1.19 ± 0.01 times faster than meson compile (version = HEAD~)Signed-off-by: Patrick Steinhardt <ps@pks.im> --- t/helper/meson.build | 1 + 1 file changed, 1 insertion(+)
diff --git a/t/helper/meson.build b/t/helper/meson.build index 3235f10ab8..ae513b4cdc 100644 --- a/t/helper/meson.build +++ b/t/helper/meson.build @@ -83,6 +83,7 @@ test_tool_sources = [ test_tool = executable('test-tool', sources: test_tool_sources, + c_pch: '../../tools/precompiled.h', dependencies: [libgit_commonmain], ) bin_wrappers += test_tool
-- 2.56.0.rc2.329.gd58861e689.dirty