Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/doc/src/guide/build-performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,26 @@ Recommendation: Periodically review unused dependencies for removal using third-
When changing code,
it can be easy to miss that a dependency is no longer used and can be removed.

> *Note:* native support for this in Cargo is being tracked in [#15813](https://github.com/rust-lang/cargo/issues/15813).
> **Note:** native support for this in Cargo is being tracked in [#15813](https://github.com/rust-lang/cargo/issues/15813).

Trade-offs:
- ✅ Faster full build and link times
- ❌ May incorrectly flag dependencies as unused or miss some

### Removing unused features from dependencies

Recommendation: Periodically review unused features from dependencies for removal using third-party tools like
[cargo-features-manager](https://crates.io/crates/cargo-features-manager),
[cargo-unused-features](https://crates.io/crates/cargo-unused-features).

When changing code,
it can be easy to miss that a dependency's feature is no longer used and can be removed.
This can reduce the number of transitive dependencies being built or
reduce the amount of code within a crate being built.
When removing features, extra caution is needed because features
may also be used for desired behavior or performance changes
which may not always be obvious from compiling or testing.

Trade-offs:
- ✅ Faster full build and link times
- ❌ May incorrectly flag features as unused