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]:
@@ -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:
