Skip to content

Commit ed3a4aa

Browse files
committed
Auto merge of #139588 - Kobzol:rust-analyzer-opt, r=jieyouxu
Use LTO to optimize Rust tools (cargo, miri, rustfmt, clippy, Rust Analyzer) Trying if LTO/PGO can help RA's performance, and by how much. As `@Noratrieb` suggested, we could actually LTO optimize all the important tools. CC `@Veykril` I realized that we don't even do LTO for Rust Analyzer, that could be a very low hanging fruit to improve its performance 😅 try-job: dist-x86_64-linux
2 parents e1b06f7 + 9a26863 commit ed3a4aa

File tree

1 file changed

+3
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+3
-1
lines changed

Diff for: src/bootstrap/src/core/build_steps/tool.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ impl Step for ToolBuild {
148148
&self.extra_features,
149149
);
150150

151-
if path.ends_with("/rustdoc") &&
151+
// Rustc tools (miri, clippy, cargo, rustfmt, rust-analyzer)
152+
// could use the additional optimizations.
153+
if self.mode == Mode::ToolRustc &&
152154
// rustdoc is performance sensitive, so apply LTO to it.
153155
is_lto_stage(&self.compiler)
154156
{

0 commit comments

Comments
 (0)