Open
Description
Problem
The release profile is used when wanting to build an optimized binary. Thus, I think it would be logical to optimize it to the fullest, sometimes at the cost of a greater build time, but I think it is a good compromise for many people, including me.
Proposed Solution
More optimizations flags should be added to the release build profile, notably lto=true and codegen-units=1, as well as optimizing all the packages with opt-level=3.
This greatly enhances runtime performance, although yes, at the cost of a bigger binary size and longer build time.
Notes
I have tested what I am proposing, with the following added in my cargo.toml:
[profile.release]
lto = true
codegen-units = 1
[profile.release.package."*"]
opt-level = 3
This improved the output binary's runtime performance by orders of magnitude, thus this issue.