Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: speedup re-compilation with flags #400

Merged
merged 2 commits into from
Jul 26, 2023
Merged

Conversation

eightfilms
Copy link
Contributor

Updates the profile stated in our Cargo.toml to use test instead of release, but inheriting release, so we can do away with specifying the release flag on cargo test.

Also toggles incremental to true - this is false by default in release profile and AFAIK doesn't slow down perf, but just stores more info to boost re-compilation speed.

This is easily verifiable (note that these compilations are not from scratch):

Current, running cargo test --release after making changes:

Finished release [optimized] target(s) in 11.90s

This PR, running cargo test after making changes:

Finished test [optimized] target(s) in 2.37s

Updates the profile stated in our `Cargo.toml` to use `test` instead of
`release`, but inheriting `release`, so we can do away with specifying
the release flag on cargo test.

Also toggles `incremental` to true - this is false by default in release
profile and AFAIK doesn't slow down perf, but just stores more info to
boost re-compilation speed.
@eightfilms eightfilms self-assigned this Jul 26, 2023
@@ -23,7 +23,7 @@ jobs:
uses: ./.github/actions/rust

- name: Run tests
run: cargo test --locked --all-targets --release
run: cargo test --locked --all-targets
Copy link
Contributor

Choose a reason for hiding this comment

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

since now you have custom profile test don't you need to use --profile test in the command ? like https://stackoverflow.com/questions/41920192/does-cargo-support-custom-profiles
or test command has its own builtin test profile ?

Copy link
Contributor

Choose a reason for hiding this comment

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

@vivekvpandya
Copy link
Contributor

Based on some discussion at rust-lang/rust#57968 this seems nice to have. However if we face any issue we can revert.

@eightfilms eightfilms merged commit a042cab into main Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants