git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: Patrick SteinhardtNext: Karthik Nayak
Message 6 of 20 in “A couple of Meson improvements”
  1. 0/7 A couple of Meson improvementsPatrick Steinhardt, Sep 24, 2026
  2. 1/7 meson: avoid recompiling HTTP sources several timesPatrick Steinhardt, Sep 24, 2026
  3. Karthik NayakSep 30, 2026
  4. Kaartic SivaraamOct 5, 2026
  5. 2/7 meson: don't recompile git-remote-http(1) multiple times for testsPatrick Steinhardt, Sep 24, 2026
  6. 3/7 meson: use precompiled headers for our test-helperPatrick Steinhardt, Sep 24, 2026
  7. Karthik NayakSep 30, 2026
  8. 4/7 meson: use precompiled headers for unit testsPatrick Steinhardt, Sep 24, 2026
  9. Kaartic SivaraamOct 5, 2026
  10. Patrick SteinhardtOct 5, 2026
  11. 5/7 meson: fix outdated completion helpersPatrick Steinhardt, Sep 24, 2026
  12. 6/7 meson: update wrappersPatrick Steinhardt, Sep 24, 2026
  13. Karthik NayakSep 30, 2026
  14. Kaartic SivaraamOct 5, 2026
  15. Patrick SteinhardtOct 5, 2026
  16. 7/7 gitlab-ci: fix hanging MSVC jobsPatrick Steinhardt, Sep 24, 2026
  17. Karthik NayakSep 30, 2026
  18. Patrick SteinhardtSep 30, 2026
  19. Karthik NayakSep 30, 2026
  20. Kaartic SivaraamOct 5, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.