Skip to content

Support a crate flag to recommend optimization #8501

Open
@joshtriplett

Description

@joshtriplett

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-profilesArea: profilesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions