Description
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
.