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
This commit is contained in:
Jonas Zohren 2021-07-12 20:18:14 +00:00
parent 888a2f7fa1
commit 0080932aef

View file

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