Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Mention ordering rationale in profiles.md
Co-authored-by: Weihang Lo <[email protected]>
  • Loading branch information
smoelius and weihanglo authored Aug 17, 2025
commit 396f8c62ed0242442d5004ffe605dfea9d5f9907
2 changes: 1 addition & 1 deletion src/doc/src/reference/profiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ The `lto` setting controls `rustc`'s [`-C lto`], [`-C linker-plugin-lto`], and
LTO can produce better optimized code, using whole-program analysis, at the cost
of longer linking time.

The valid options are:
The valid options from most to least optimizing are:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, this is not true in the general case. fat LTO can produce faster executables than ThinLTO and even if it doesn't, it is often very close. ThinLTO just generally produces a bit bigger executables.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So in terms of executable performance,

is it fat >= ThinLTO or ThinLTO >= fat, or hard to say?

Copy link
Member

@bjorn3 bjorn3 Aug 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand it, it could be either way nowadays. There is probably still some bias for fat LTO producing faster executables than ThinLTO though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Thanks for pointing it out!

There is another similar ongoing in rust-lang/rust rust-lang/rust#145533. Do you think we should r- that, and revert this PR as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the order makes sense. I just think we should not explicitly say "from most to least optimizing" here.


* `true` or `"fat"`: Performs "fat" LTO which attempts to perform
optimizations across all crates within the dependency graph.
Expand Down
Loading