Skip to content

Conversation

@chenyukang
Copy link
Member

@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2026

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2026
@chenyukang
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 19, 2026
Fix performance issue in liveness checking
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
Copy link
Member

@lqd lqd left a comment

Choose a reason for hiding this comment

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

Cool. r=me with green perf

View changes since this review

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 19, 2026

☀️ Try build successful (CI)
Build commit: 3a8fd6c (3a8fd6ccca553ed0605e839cc9eac17a3aa80166, parent: d940e56841ddcc05671ead99290e35ff2e98369f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3a8fd6c): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.1% [0.1%, 0.2%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (secondary 3.9%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

Results (secondary -2.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 473.058s -> 474.35s (0.27%)
Artifact size: 383.29 MiB -> 383.32 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 19, 2026
@chenyukang
Copy link
Member Author

@bors r=lqd

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

📌 Commit 54f9a44 has been approved by lqd

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2026
@lqd
Copy link
Member

lqd commented Jan 20, 2026

It didn’t fix the issue you were trying to fix, right?

@chenyukang
Copy link
Member Author

It didn’t fix the issue you were trying to fix, right?

seems that PR #150955 don't have that big performance regression:
#150955 (comment)

@lqd
Copy link
Member

lqd commented Jan 20, 2026

It doesn't indeed.

@lqd
Copy link
Member

lqd commented Jan 20, 2026

In any case, this new code is in a good spot now (but it's also not clear that it was causing much in the previous place) so let's land it.

Comment on lines 1116 to 1119
// By convention, underscore-prefixed bindings are explicitly allowed to be unused.
if name.as_str().starts_with('_') {
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is inside the loop, so this lookup can be done multiple times after this change, right? Could that be the issue?

For positive cases we can also just break, too.

Suggested change
// By convention, underscore-prefixed bindings are explicitly allowed to be unused.
if name.as_str().starts_with('_') {
continue;
}
// By convention, underscore-prefixed bindings are explicitly allowed to be unused.
if name.as_str().starts_with('_') {
break;
}

Copy link
Member

@lqd lqd Jan 20, 2026

Choose a reason for hiding this comment

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

I saw that but the only way this would matter is if the benchmarks code emits unused warnings today, and we'd be thus benchmarking diagnostics?

Copy link
Contributor

@panstromek panstromek Jan 21, 2026

Choose a reason for hiding this comment

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

Hmm, right. I guess I'm just perplexed by the results. For code that never emitted these warnings, this PR should be strictly less work, because they never reach this branch anyway, but instead it's a regression. That doesn't make any sense to me. At least it should undo the previous regression in unicode-normalization, but those benchmarks didn't move above the treshold, or slightly regressed, if anything (I'm assuming unicode-normalization doesn't emit unused-assignemnts).

Copy link
Member

Choose a reason for hiding this comment

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

were you able to check @chenyukang? break makes sense to us, but the results are also strange: not knowing whether they impact benchmarks unexpectedly due to diagnostics.

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, seems better, updated the code.

Copy link
Member

Choose a reason for hiding this comment

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

what did you learn, are we unexpectedly looking at codepaths that are only exercised through diagnostics emitted by the benchmarks?

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 20, 2026
Fix performance issue in liveness checking

r? @ghost

from #150955 (comment)
@rust-log-analyzer

This comment has been minimized.

@rust-bors rust-bors bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 20, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 20, 2026

💔 Test for 399f6ba failed: CI. Failed job:

@chenyukang
Copy link
Member Author

There error is cannot open file descriptor 3 from the jobserver environment variable value: Bad file descriptor (os error 9), seems unrelated to my change.

@bors try jobs=x86_64-gnu-aux

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 27, 2026
Fix performance issue in liveness checking


try-job: x86_64-gnu-aux
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 27, 2026

☀️ Try build successful (CI)
Build commit: b548f68 (b548f68481ab156f026c547e926c00a3bcf048f3, parent: ebf13cca58b551b83133d4895e123f7d1e795111)

@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 27, 2026
@rust-log-analyzer

This comment has been minimized.

@chenyukang
Copy link
Member Author

anyway, let's run a perf again

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Jan 30, 2026
Fix performance issue in liveness checking
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 30, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 30, 2026

☀️ Try build successful (CI)
Build commit: 98437b3 (98437b3d28233c3a5d7a8d07f1459ed8ea5b1068, parent: ef2657cbaf6885b71e5ffd277ffe72a2616c0a7c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (98437b3): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 545.612s -> 476.413s (-12.68%)
Artifact size: 397.86 MiB -> 397.86 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 30, 2026
@lqd
Copy link
Member

lqd commented Jan 30, 2026

Great, no noise, @bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 30, 2026

📌 Commit d2aa64f has been approved by lqd

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 30, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants