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

Support a crate flag to recommend optimization #8501

Open
joshtriplett opened this issue Jul 17, 2020 · 0 comments
Open

Support a crate flag to recommend optimization #8501

joshtriplett opened this issue Jul 17, 2020 · 0 comments
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`

Comments

@joshtriplett
Copy link
Member

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.

@joshtriplett joshtriplett added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Jul 17, 2020
@ehuss ehuss added the A-profiles Area: profiles label Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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`
Projects
None yet
Development

No branches or pull requests

2 participants