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

Running cargo-wizard to speed up compilation times. #5279

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dessalines
Copy link
Member

Running cargo-wizard to optimize dev and release profiles.

This greatly speeded up my compilation times.

#5273

Copy link
Member Author

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.

@dessalines dessalines marked this pull request as draft December 22, 2024 18:40
Comment on lines 28 to +33
[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"
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

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