Skip to content

BitSet related perf improvements #97863

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2022
Merged

Conversation

JakobDegen
Copy link
Contributor

@JakobDegen JakobDegen commented Jun 8, 2022

This commit makes two changes:

  1. Changes MaybeLiveLocals to use ChunkedBitSet
  2. Overrides the fold method for the iterator for ChunkedBitSet

I have local benchmarks verifying that each of these changes individually yield significant perf improvements to #96451 . I'm hoping this will be true outside of that context too. If that is not the case, I'll try to gate things on where they help as needed

r? @nnethercote who I believe was working on closely related things, cc @tmiasko because of the destprop pr

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 8, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 8, 2022
@JakobDegen
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 8, 2022
@bors
Copy link
Collaborator

bors commented Jun 8, 2022

⌛ Trying commit 9fc58edd46d568c75affa6a27b1c4c77dbbe4cdc with merge 18b9172199f08c174c4f5a8540efd1e8ef0bdb12...

@bors
Copy link
Collaborator

bors commented Jun 8, 2022

☀️ Try build successful - checks-actions
Build commit: 18b9172199f08c174c4f5a8540efd1e8ef0bdb12 (18b9172199f08c174c4f5a8540efd1e8ef0bdb12)

@rust-timer
Copy link
Collaborator

Queued 18b9172199f08c174c4f5a8540efd1e8ef0bdb12 with parent 64a7aa7, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (18b9172199f08c174c4f5a8540efd1e8ef0bdb12): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.3% 2.3% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

Cycles

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

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

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

Footnotes

  1. the arithmetic mean of the percent change

  2. number of relevant changes

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 8, 2022
@JakobDegen
Copy link
Contributor Author

Wow, that's rather surprising, I expected this code to be perf sensitive. In any case, I'd like to merge this as it brings benefits in destprop which I assume will get merged and turned on at some point

@nnethercote
Copy link
Contributor

The code looks reasonable, but we'll need some tests added to compiler/rustc_index/src/bit_set/tests.rs before merging, because it's easy to miss edge cases in this code and testing will increase confidence. Thanks.

Copy link
Contributor

@nnethercote nnethercote left a comment

Choose a reason for hiding this comment

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

Changes need, see above.

@nnethercote nnethercote 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 Jun 10, 2022
This commit makes two changes:
 1. Changes `MaybeLiveLocals` to use `ChunkedBitSet`
 2. Overrides the `fold` method for the iterator for `ChunkedBitSet`
@JakobDegen
Copy link
Contributor Author

Addressed comments

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 15, 2022
@nnethercote
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 17, 2022

📌 Commit bc7cd2f has been approved by nnethercote

@bors bors 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 Jun 17, 2022
@bors
Copy link
Collaborator

bors commented Jun 17, 2022

⌛ Testing commit bc7cd2f with merge ecdd374...

@bors
Copy link
Collaborator

bors commented Jun 17, 2022

☀️ Test successful - checks-actions
Approved by: nnethercote
Pushing ecdd374 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 17, 2022
@bors bors merged commit ecdd374 into rust-lang:master Jun 17, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 17, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ecdd374): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.8% -2.8% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
4.4% 4.4% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@JakobDegen JakobDegen deleted the bitset-choice branch June 21, 2022 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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