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

Perf: Optimize guest builds #130

Merged
merged 4 commits into from
Dec 18, 2024
Merged

Perf: Optimize guest builds #130

merged 4 commits into from
Dec 18, 2024

Conversation

hashcashier
Copy link
Contributor

No description provided.

@hashcashier hashcashier requested review from flaub and Wollac December 14, 2024 05:42
@hashcashier hashcashier self-assigned this Dec 14, 2024
Comment on lines 11 to 12
[profile.dev.build-override]
opt-level = 3
Copy link
Member

Choose a reason for hiding this comment

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

build-override isn't needed anymore

Copy link
Contributor Author

Choose a reason for hiding this comment

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

somehow I think this is still affecting cycle count after a clean build

Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand the docs, build-override only affects how build scripts etc. are built, not the actual crate, so it should have no effect on the cycle count except for some random noise.

Copy link
Contributor

Choose a reason for hiding this comment

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

In that context, I don't even understand how the dev profile affects cycle counts, since everything is supposed to be built in release.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The dev profile indeed had no effect but build-override still does shake off a couple million cycles for some reason.

@hashcashier hashcashier changed the title Perf: Enable LTO for guest builds Perf: Optimize guest builds Dec 14, 2024
@hashcashier hashcashier requested a review from flaub December 14, 2024 08:03
Comment on lines 9 to 12
codegen-units = 1
debug = 1
lto = "fat"
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.

opt-level and debug is already included in the default release profile and won't have any effect.

Suggested change
codegen-units = 1
debug = 1
lto = "fat"
opt-level = 3
codegen-units = 1
lto = "fat"

Copy link
Contributor Author

@hashcashier hashcashier Dec 18, 2024

Choose a reason for hiding this comment

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

While opt-level is already 3 in release, the default for debug is 0:

https://doc.rust-lang.org/cargo/reference/profiles.html#release

debug = 1 has a minor improvement for cycle counts for me.

@hashcashier hashcashier merged commit 392b34c into main Dec 18, 2024
7 checks passed
@hashcashier hashcashier deleted the guest-lto branch December 18, 2024 06:41
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.

3 participants