From 0080932aef8effc75ff6ca508eaa0fc3da23c16a Mon Sep 17 00:00:00 2001 From: Jonas Zohren Date: Mon, 12 Jul 2021 20:18:14 +0000 Subject: [PATCH] Speed up release builds Setting cargo to run incremental builds means partial build results should be cached. This is not enabled by default in release mode. Incremental builds use 256 codegen units by default [1]. We set them to 16 (release default) again for somewhat faster code but slightly slower builds. [1]: https://doc.rust-lang.org/cargo/reference/profiles.html#codegen-units --- .gitlab-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 14c10ed1..2fb9d542 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -60,6 +60,9 @@ test:cargo: - "apt-get install -yqq --no-install-recommends $NEEDED_PACKAGES" - "rustup target add $TARGET" script: + # Set some cargo tuning here, because targets overwrite the 'variables' + - "export CARGO_INCREMENTAL=true" + - "export CARGO_PROFILE_RELEASE_CODEGEN_UNITS=16" - time cargo build --target $TARGET --release - 'mv "target/$TARGET/release/conduit" "conduit-$TARGET"' artifacts: