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
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions guests/reth-ethereum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ edition = "2021"

[workspace]

[profile.release]
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.


[profile.release.build-override]
codegen-units = 1
opt-level = 3

[dependencies.risc0-zkvm]
git = "https://github.com/risc0/risc0"
rev = "e98cdad96cfecb3d959cb62abf566e5b17a0d649"
Expand Down
10 changes: 10 additions & 0 deletions guests/reth-optimism/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ edition = "2021"

[workspace]

[profile.release]
codegen-units = 1
debug = 1
lto = "fat"
opt-level = 3

[profile.release.build-override]
codegen-units = 1
opt-level = 3

[dependencies.risc0-zkvm]
git = "https://github.com/risc0/risc0"
rev = "e98cdad96cfecb3d959cb62abf566e5b17a0d649"
Expand Down
Loading