Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Use RUSTFLAGS to set the optimization level #10719

Merged
merged 10 commits into from
Jun 7, 2019
Merged
6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ path = "parity/lib.rs"
path = "parity/main.rs"
name = "parity"

[profile.dev]

[profile.test]
lto = false
opt-level = 3 # makes tests slower to compile, but faster to run

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might work: RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C incremental=false -C debuginfo=2" time cargo test -v

These are the settings for release mode I think:

The release profile, used for cargo build --release (and the dependencies

for cargo test --release, including the local library or binary).

[profile.release]
opt-level = 3
debug = false
rpath = false
lto = false
debug-assertions = false
codegen-units = 16
panic = 'unwind'
incremental = false
overflow-checks = false

[profile.release]
debug = false
lto = true
Expand Down
2 changes: 1 addition & 1 deletion scripts/gitlab/test-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ rustup default $1
rustup show

echo "________Running Parity Full Test Suite________"
time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS
CARGO_INCREMENTAL=0 RUSTFLAGS="-C opt-level=3 -C overflow-checks=off -C debuginfo=2" time cargo test $OPTIONS --features "$FEATURES" --locked --all --target $CARGO_TARGET --verbose --color=always -- --test-threads $THREADS
ordian marked this conversation as resolved.
Show resolved Hide resolved