Skip to content

Conversation

john-michaelburke
Copy link
Collaborator

@john-michaelburke john-michaelburke commented Sep 10, 2021

Three suggestions for speeding up CI from this article:
https://matklad.github.io/2021/09/04/fast-rust-builds.html

  • Disable incremental builds.
  • Disable debug info.
  • Use a different Rust cache action specifically tailored for Rust.

Results:
Consider a pass as a new commit to the PR triggering a rebuild.

  • In terms of first run of a new PR it appears to be the same as our current CI give or take:
    • Old build (first pass): Total Duration: ~57m, Total Billable: ~2hr20m
    • New build (first pass): Total Duration: ~57m, Total Billable ~2hr15m
  • In terms of second or more pass through a PR:
    • Old build (2+ pass): Total Duration: ~55m, Total Billable: ~2hr7m
    • New build (2+ pass): Total Duration: ~40m, Total Billable: ~1hr30m

Shows a large improvement on second plus passes through PRs.

@john-michaelburke john-michaelburke changed the title Speed up CI 2/3 suggestions. Minor Rust build improvements. Sep 10, 2021
@john-michaelburke john-michaelburke marked this pull request as ready for review September 10, 2021 19:48
@john-michaelburke john-michaelburke requested a review from a team September 10, 2021 19:49
edition = "2018"

[profile.dev]
debug = 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably only want to do this in CI, right? What's the impact on the ability to use gdb if this is disabled?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah it is no good for gdb use. I confirmed that rustflags do get distributed correctly so added this to the environment vars.

Cargo.toml Outdated
[profile.release]
lto = true
codegen-units = 1
opt-level = 3
Copy link
Contributor

Choose a reason for hiding this comment

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

This is unnecessary since it's the default for release: https://doc.rust-lang.org/cargo/reference/profiles.html#release

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we could try 'z' or 's' and see if it shrinks the installer size?

Cargo.toml Outdated
[profile.release]
lto = true
codegen-units = 1
opt-level = "z"
Copy link
Contributor

Choose a reason for hiding this comment

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

This didn't change anything, so we should probably dump it

@john-michaelburke john-michaelburke merged commit d0995c4 into main Sep 12, 2021
@john-michaelburke john-michaelburke deleted the john-michaelburke/cicd branch September 12, 2021 03:24
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