Skip to content

Commit

Permalink
feat: enable LTO and codegen-units = 1 optimization (#20927)
Browse files Browse the repository at this point in the history
## Description 

Enable Link-Time Optimization (LTO) for the project and other
optimization

## Test plan 

building process is successfully completed

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:

---------

Co-authored-by: mwtian <[email protected]>
  • Loading branch information
kiwamizamurai and mwtian authored Jan 24, 2025
1 parent fb61188 commit 6f5fbfd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,14 @@ strip = 'debuginfo'
# Exit process with SIGABRT when any thread panics
panic = 'abort'

# Same as release, but build with lto (~50min build time).
[profile.release-lto]
inherits = "release"
# Enable Link Time Optimization for better runtime performance
lto = true
# Use single codegen unit to enable better optimizations
codegen-units = 1

# Same as release, but build binary with debug symbols (binary size will be ~ 1GB).
[profile.release-dbgsym]
inherits = "release"
Expand Down

0 comments on commit 6f5fbfd

Please sign in to comment.