-
-
Notifications
You must be signed in to change notification settings - Fork 886
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
Running cargo-wizard to speed up compilation times. #5279
base: main
Are you sure you want to change the base?
Conversation
.cargo/config.toml
Outdated
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.
I'm not sure if this file should be checked in, because it requires rust nightly, and the threads is specific to your machine. But it did speed up compilation a LOT.
[profile.release] | ||
debug = 0 | ||
lto = "fat" | ||
debug = false | ||
lto = true | ||
opt-level = 3 # Optimize for speed, not size. | ||
codegen-units = 1 # Reduce parallel code generation. | ||
panic = "abort" |
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.
Besides the impact on compilation speed, do these changes affect the performace of the compiled code like speed or binary size?
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.
The debug and lto aren't real changes (just using different names for the same thing), but the panic abort is supposed to increase performance.
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 had the biggest performance benefit while developing, but unfortunately can't be used for lemmy builds or CI. Not sure what the best way to handle this would be.
Maybe just provide this in the development instructions only? Not sure.
Running cargo-wizard to optimize
dev
andrelease
profiles.This greatly speeded up my compilation times.
#5273