Skip to content

Commit

Permalink
Merge pull request #366 from Eekle/master
Browse files Browse the repository at this point in the history
Mention generics in "optimizing dependencies"
  • Loading branch information
adamgreig authored Jan 29, 2024
2 parents 3f9df2b + 953d293 commit 2e95fc2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/unsorted/speed-vs-size.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ override the optimization level of dependencies. You can use that feature to
optimize all dependencies for size while keeping the top crate unoptimized and
debugger friendly.

Beware that generic code can sometimes be optimized alongside the crate where it
is instantiated, rather than the crate where it is defined. If you create an
instance of a generic struct in your application and find that it pulls in code
with a large footprint, it may be that increasing the optimisation level of the
relevant dependencies has no effect.

[`profile-overrides`]: https://doc.rust-lang.org/cargo/reference/profiles.html#overrides

Here's an example:
Expand Down

0 comments on commit 2e95fc2

Please sign in to comment.