Skip to content

Experiment with the mostly-unused Cargo hint to optimize compile times for downstream users #3664

@alice-i-cecile

Description

@alice-i-cecile

Suggestion

As explained in this call for testing, this hint can reduce the amount of time spent compiling and optimizing code that is thrown away.

If you maintain a crate that has a large API surface, and you expect that the typical user might use only a fraction of it, try setting hints.mostly-unused in your Cargo.toml

windows is a great candidate for this! This is especially true for downstream users (like Bevy) who depend on multiple copies of the windows crate transitively (see bevyengine/bevy#11244).

As the blog post says, if you do this, please report your findings in rust-lang/cargo#15644 <3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions