-
Notifications
You must be signed in to change notification settings - Fork 119
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
Disable debug info compilation in CI to boost performance. #779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Smaller cache sizes are great! It's especially important for the snapshots LFS workaround
Cargo.toml
Outdated
@@ -128,5 +128,7 @@ time = "0.3.36" | |||
|
|||
[profile.ci] | |||
inherits = "dev" | |||
debug = 0 # Don't compile debug info to reduce compilation artifact size for cache benefits. | |||
strip = "debuginfo" # Implied with debug = 0 since Rust 1.77, still useful for older. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence doesn't scan to me - older
doesn't really work as a subject. Maybe something like:
strip = "debuginfo" # Implied with debug = 0 since Rust 1.77, still useful for older. | |
strip = "debuginfo" # Implied by debug = 0 since Rust 1.77 - but our MSRV is older. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's meant to be copy-pastable and in Xilem's case the MSRV is actually newer than 1.77. I adjusted the comment but made the MSRV reference a bit more conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MSRV will be 1.82 as soon as this gets updated Peniko or Vello.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just not have the comment at all? The redundancy doesn't have any real cost
Turning off debug info in CI gives us tiny speedups, with potential for more in some scenarios. Most notably there is 30% space savings on artifact size in Linux, really helping with cache pressure and compression/decompression time.
We don't really need the benefits of debug info in the CI environment. We're not attaching debuggers there and in case of panics we can still get a backtrace. Thus it's just wasted effort to generate the debug info and then to link it in and cache it.
Benchmarks
I did some minor benchmarking on three different OS setups with Rust 1.83. Every step was repeated four times (1 warmup, then 3 for measuring), but stuff like CPU boost frequency etc was not controlled for. Even so, the numbers are useful for ballparking.
I set
CARGO_INCREMENTAL
to0
to match the CI and measuredcargo clippy -p xilem --locked --profile ci --all-features
.