Support a crate flag to recommend optimization #8501
Labels
A-profiles
Area: profiles
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
As a further enhancement to #8500 , we'd like to have an option in
Cargo.toml
for a library crate to specify that it should almost always be optimized unless specifically requested otherwise.This would be for crates like phf or lalrpop or munkres, where the optimization level makes a massive performance difference.
We could pay attention to this option whenever we're building with a "default" opt-level of 0, such as for build-dependencies with #8500 , or for dev/test builds. If a crate explicitly says that the dependency should use opt-level 0, we would do that, but if we're only using opt-level 0 because of a built-in default, then a dependency's
Cargo.toml
specifying to optimize it would be respected.I'd suggest an option like
default-optimized = true
.The text was updated successfully, but these errors were encountered: