Fix performance issue in liveness checking#151376
Fix performance issue in liveness checking#151376rust-bors[bot] merged 1 commit intorust-lang:mainfrom
Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (3a8fd6c): comparison URL. Overall result: ❌ regressions - no action neededBenchmarking 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 Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
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.
CyclesResults (secondary -2.5%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 473.058s -> 474.35s (0.27%) |
|
@bors r=lqd |
|
It didn’t fix the issue you were trying to fix, right? |
seems that PR #150955 don't have that big performance regression: |
|
It doesn't indeed. |
|
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. |
| // By convention, underscore-prefixed bindings are explicitly allowed to be unused. | ||
| if name.as_str().starts_with('_') { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
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.
| // 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; | |
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
yeah, seems better, updated the code.
There was a problem hiding this comment.
what did you learn, are we unexpectedly looking at codepaths that are only exercised through diagnostics emitted by the benchmarks?
There was a problem hiding this comment.
break seems more efficient in theory, but no performance improvement in practice, i think diagnostics emitting is general not in hotpath, don't understand why #150955 (comment) happened, this PR should make sure name.as_str().starts_with('_') only executed when there is an error, but #151376 (comment) makes no change.
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking r? @ghost from #150955 (comment)
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 399f6ba failed: CI. Failed job:
|
|
There error is @bors try jobs=x86_64-gnu-aux |
54f9a44 to
abf0f4a
Compare
This comment has been minimized.
This comment has been minimized.
abf0f4a to
441cba2
Compare
441cba2 to
d2aa64f
Compare
|
anyway, let's run a perf again @bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fix performance issue in liveness checking
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (98437b3): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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 Instruction countThis 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. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 545.612s -> 476.413s (-12.68%) |
|
Great, no noise, @bors r+ rollup |
…uwer Rollup of 4 pull requests Successful merges: - #151376 (Fix performance issue in liveness checking) - #151851 (Remove redundant `IntoQueryParam` calls from query plumbing) - #151854 (Show break type expectation cause for let-else) - #151859 (Disable append-elements.rs test with debug assertions)
Rollup merge of #151376 - chenyukang:yukang-fix-perf, r=lqd Fix performance issue in liveness checking r? @ghost from #150955 (comment)
… r=workingjubilee Disable flaky test `oneshot::recv_timeout_before_send` This test is inherently flaky due to a thread-scheduling race condition, and has failed several times in CI, e.g.: - rust-lang#151739 (comment) - rust-lang#151971 (comment) - rust-lang#151376 (comment) --- - cc @connortsui20, author of rust-lang#143741
… r=workingjubilee Disable flaky test `oneshot::recv_timeout_before_send` This test is inherently flaky due to a thread-scheduling race condition, and has failed several times in CI, e.g.: - rust-lang#151739 (comment) - rust-lang#151971 (comment) - rust-lang#151376 (comment) --- - cc @connortsui20, author of rust-lang#143741
Rollup merge of #152145 - Zalathar:recv-timeout-before-send, r=workingjubilee Disable flaky test `oneshot::recv_timeout_before_send` This test is inherently flaky due to a thread-scheduling race condition, and has failed several times in CI, e.g.: - #151739 (comment) - #151971 (comment) - #151376 (comment) --- - cc @connortsui20, author of #143741
…gjubilee Disable flaky test `oneshot::recv_timeout_before_send` This test is inherently flaky due to a thread-scheduling race condition, and has failed several times in CI, e.g.: - rust-lang/rust#151739 (comment) - rust-lang/rust#151971 (comment) - rust-lang/rust#151376 (comment) --- - cc @connortsui20, author of rust-lang/rust#143741
r? @ghost
from #150955 (comment)