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

[PATCH v2 3/7] ci: build optimized binaries with Meson

From
Patrick Steinhardt <ps@pks.im>
Date
Nov 9, 2026, 09:58 UTC
Message-ID
<20261109-pks-gitlab-ci-speedups-v2-3-508832602d0b@pks.im>
In-Reply-To
<20261109-pks-gitlab-ci-speedups-v2-0-508832602d0b@pks.im>

When taking a look at our CI jobs one will quickly notice that across the Linux-based jobs, the "fedora-breaking-changes-meson" job is running significantly longer than any of the other jobs. While most Linux jobs only run around 15 minutes, that particular job runs roughly twice as long.

The root cause of this is a combination of two different things:
  - The job uses Meson to compile Git, and Meson by default uses the
    "debug" build type that translates into "-O0". Our Makefile in
    contrast to that uses "-g -O2" by default.
  - The job enables breaking changes and thus runs with SHA256 by
    default with the "block" backend, which benefits heavily from
    compiler optimizations. For example, hashing a 500MB blob with
    SHA256 takes 9.6 seconds with "-O0", whereas it takes only 1.5
    seconds with "-O2". The SHA1 code path only slows down from 0.9
    seconds to 2.1 seconds with "-O0".

Of course, compiling without optimizations also has an impact on all the other jobs, but the Fedora job is by far the most impacted one.

Speed up executing the tests by using the "debugoptimized" build type instead. This reduces the runtime of "fedora-breaking-changes-meson" from 2100 to 1000 seconds. Other Linux- and macOS-based jobs benefit as well, but they only speed up by around ~10%.

On Windows though this is a bit more muddy, as the build step gets almost two minutes slower, whereas tests only run ~10% faster. Combined though the total run time is roughly the same before and after this change.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 .gitlab-ci.yml            | 2 +-
 ci/run-build-and-tests.sh | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3631393a8cc..449fed1b392 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -182,7 +182,7 @@ build:msvc-meson:
   extends: .msvc-meson
   stage: build
   script:
-    - meson setup build --vsenv -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred -Dtest_output_directory="$TEST_OUTPUT_DIRECTORY"
+    - meson setup build --vsenv --buildtype=debugoptimized -Dperl=disabled -Dbackend_max_links=1 -Dcredential_helpers=wincred -Dtest_output_directory="$TEST_OUTPUT_DIRECTORY"
     - meson compile -C build
   artifacts:
     paths:
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
index 68b91e31439..fd8136af342 100755
--- a/ci/run-build-and-tests.sh
+++ b/ci/run-build-and-tests.sh
@@ -55,6 +55,7 @@ case "$jobname" in
 		--fatal-meson-warnings \
 		--warnlevel 2 --werror \
 		--wrap-mode nofallback \
+		--buildtype=debugoptimized \
 		-Dfuzzers=true \
 		-Dtest_output_directory="${TEST_OUTPUT_DIRECTORY:-$(pwd)/t}" \
 		$MESONFLAGS
-- 
2.56.0.611.g1030f0b940.dirty
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 22 of 40 in “ci: some speedups for slow tests”
  1. 0/7 ci: some speedups for slow testsPatrick Steinhardt, Nov 6, 2026
  2. 1/7 gitlab-ci: speed up installation of Git for Windows SDKPatrick Steinhardt, Nov 6, 2026
  3. Junio C HamanoNov 6, 2026
  4. Patrick SteinhardtNov 9, 2026
  5. 2/7 gitlab-ci: exclude intermediate outputs from Windows artifactsPatrick Steinhardt, Nov 6, 2026
  6. 3/7 ci: build optimized binaries with MesonPatrick Steinhardt, Nov 6, 2026
  7. Junio C HamanoNov 6, 2026
  8. 4/7 t0027: optimize how we reset repository statePatrick Steinhardt, Nov 6, 2026
  9. Junio C HamanoNov 6, 2026
  10. Torsten BögershausenNov 8, 2026
  11. Patrick SteinhardtNov 9, 2026
  12. 5/7 t0027: cache expected output filesPatrick Steinhardt, Nov 6, 2026
  13. 6/7 t1092: set up repositories from templatesPatrick Steinhardt, Nov 6, 2026
  14. 7/7 t5551: use reftables for repositories with many refsPatrick Steinhardt, Nov 6, 2026
  15. Junio C HamanoNov 6, 2026
  16. 0/7 ci: some speedups for slow testsPatrick Steinhardt, Nov 9, 2026
  17. 1/7 gitlab-ci: speed up installation of Git for Windows SDKPatrick Steinhardt, Nov 9, 2026
  18. Junio C HamanoNov 9, 2026
  19. Patrick SteinhardtNov 10, 2026
  20. Junio C HamanoNov 10, 2026
  21. 2/7 gitlab-ci: exclude intermediate outputs from Windows artifactsPatrick Steinhardt, Nov 9, 2026
  22. 3/7 ci: build optimized binaries with MesonPatrick Steinhardt, Nov 9, 2026
  23. 4/7 t0027: optimize how we reset repository statePatrick Steinhardt, Nov 9, 2026
  24. Junio C HamanoNov 9, 2026
  25. Patrick SteinhardtNov 10, 2026
  26. 5/7 t0027: cache expected output filesPatrick Steinhardt, Nov 9, 2026
  27. Torsten BögershausenNov 9, 2026
  28. Patrick SteinhardtNov 10, 2026
  29. Torsten BögershausenNov 10, 2026
  30. 6/7 t1092: set up repositories from templatesPatrick Steinhardt, Nov 9, 2026
  31. 7/7 t5551: use reftables for repositories with many refsPatrick Steinhardt, Nov 9, 2026
  32. Johannes SixtNov 12, 2026
  33. 0/7 ci: some speedups for slow testsPatrick Steinhardt, Nov 11, 2026
  34. 1/7 gitlab-ci: speed up installation of Git for Windows SDKPatrick Steinhardt, Nov 11, 2026
  35. 2/7 gitlab-ci: exclude intermediate outputs from Windows artifactsPatrick Steinhardt, Nov 11, 2026
  36. 3/7 ci: build optimized binaries with MesonPatrick Steinhardt, Nov 11, 2026
  37. 4/7 t0027: optimize how we reset repository statePatrick Steinhardt, Nov 11, 2026
  38. 5/7 t0027: cache expected output filesPatrick Steinhardt, Nov 11, 2026
  39. 6/7 t1092: set up repositories from templatesPatrick Steinhardt, Nov 11, 2026
  40. 7/7 t5551: use reftables for repositories with many refsPatrick Steinhardt, Nov 11, 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.