From 471c0b53d2da13b8bf1b66e69155069561afa156 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ha=CC=88cker?= Date: Mon, 3 Mar 2025 19:59:37 +0100 Subject: [PATCH] mumble: Add build option CMAKE_UNITY_BUILD for compilation speed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This provides a significant speed boost to the compilation. Almost 70% improvement in my experiments. # plain build ❯ nx hyperfine 'nix build .#mumble --rebuild' --warmup 1 --ignore-failure Benchmark 1: nix build .#mumble --rebuild Time (mean ± σ): 73.287 s ± 2.462 s [User: 0.679 s, System: 3.338 s] Range (min … max): 69.478 s … 77.686 s 10 runs # unity build ❯ nx hyperfine 'nix build .#mumble --rebuild' --warmup 1 --ignore-failure Benchmark 1: nix build .#mumble --rebuild Time (mean ± σ): 42.713 s ± 1.435 s [User: 0.089 s, System: 1.216 s] Range (min … max): 39.891 s … 44.800 s 10 runs --- pkgs/applications/networking/mumble/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index fda05185adff..f97d0f44bf77 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -72,6 +72,7 @@ let "-D g15=OFF" "-D CMAKE_CXX_STANDARD=17" # protobuf >22 requires C++ 17 "-D BUILD_NUMBER=${lib.versions.patch source.version}" + "-D CMAKE_UNITY_BUILD=ON" # Upstream uses this in their build pipeline to speed up builds "-D bundled-gsl=OFF" "-D bundled-json=OFF" ]