Skip to content
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

Reduce BitSet size used in Borrows dataflow analysis #111396

Merged

Conversation

vlad20012
Copy link
Member

@vlad20012 vlad20012 commented May 9, 2023

It looks like it is not needed to multiply the number of borrows by 2. Bits greater than self.borrow_set.len() are never set in this bitset. This should decrease the memory usage by an epsilon.

@rustbot
Copy link
Collaborator

rustbot commented May 9, 2023

r? @cjgillot

(rustbot has picked a reviewer for you, use r? to override)

@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 May 9, 2023
@Kobzol
Copy link
Contributor

Kobzol commented May 9, 2023

@bors try @rust-timer queue

(:wave: @vlad20012! :D )

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 9, 2023
@bors
Copy link
Contributor

bors commented May 9, 2023

⌛ Trying commit 6989246 with merge 5ea3d7fdc513e2d1c07b0fe05cef5c2fe684447f...

@vlad20012
Copy link
Member Author

I traced it up to a849da6 (#49836). The multiplication by 2 should have been removed in that commit.

Btw I don't expect any measurable performance/memory improvements since the BitSet should usually be small. It's rather just a cleanup.

@bors
Copy link
Contributor

bors commented May 9, 2023

☀️ Try build successful - checks-actions
Build commit: 5ea3d7fdc513e2d1c07b0fe05cef5c2fe684447f (5ea3d7fdc513e2d1c07b0fe05cef5c2fe684447f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5ea3d7fdc513e2d1c07b0fe05cef5c2fe684447f): comparison URL.

Overall result: ❌ regressions - no action needed

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-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.4% [0.3%, 0.5%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.9% [-3.6%, -2.1%] 3
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-8.6% [-9.2%, -8.2%] 6
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 657.767s -> 658.566s (0.12%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 10, 2023
@cjgillot
Copy link
Contributor

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented May 10, 2023

📌 Commit 6989246 has been approved by cjgillot

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented May 10, 2023

🌲 The tree is currently closed for pull requests below priority 50. This pull request will be tested once the tree is reopened.

@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 May 10, 2023
@bors
Copy link
Contributor

bors commented May 11, 2023

⌛ Testing commit 6989246 with merge 192f3950f0dbfb69647978011f930673c8fcfdda...

@bors
Copy link
Contributor

bors commented May 11, 2023

💔 Test failed - checks-actions

@bors bors 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 May 11, 2023
@rust-log-analyzer
Copy link
Collaborator

A job failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

@cjgillot
Copy link
Contributor

@bors retry

@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 May 11, 2023
@bors
Copy link
Contributor

bors commented May 12, 2023

⌛ Testing commit 6989246 with merge 4a59ba4...

@bors
Copy link
Contributor

bors commented May 12, 2023

☀️ Test successful - checks-actions
Approved by: cjgillot
Pushing 4a59ba4 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 12, 2023
@bors bors merged commit 4a59ba4 into rust-lang:master May 12, 2023
@rustbot rustbot added this to the 1.71.0 milestone May 12, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4a59ba4): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-2.7% [-3.1%, -2.3%] 4
All ❌✅ (primary) -1.6% [-1.6%, -1.6%] 1

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.2% [1.7%, 4.0%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 659.596s -> 659.191s (-0.06%)

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.

7 participants