Skip to content

Use bitset for locals_with_use_data - #161476

Open
panstromek wants to merge 1 commit into
rust-lang:mainfrom
panstromek:use-bitset-locals-with-use-data
Open

Use bitset for locals_with_use_data#161476
panstromek wants to merge 1 commit into
rust-lang:mainfrom
panstromek:use-bitset-locals-with-use-data

Conversation

@panstromek

@panstromek panstromek commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

There seems to be very little reason to use Vec of bools, the whole map allocates space for every element anyway.

Not sure how is impactful this is, I noticed it randomly in the code, but this seems like cleaner way to do it (and more common in the compiler codebase)

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 21, 2026
There seems to be very little reason to use Vec of bools, the whole map allocates space for every element anyway.
@panstromek
panstromek force-pushed the use-bitset-locals-with-use-data branch from 2220f48 to 823b923 Compare August 21, 2026 17:36
@panstromek

Copy link
Copy Markdown
Contributor Author

Let's check just in case

@bors try @rust-timer queue

@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 Aug 21, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 21, 2026
…=<try>

Use bitset for locals_with_use_data
@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 43bc7f3 (43bc7f388e0ac4d2209ef1c38e8641b380cbbc9c)
Base parent: b662191 (b66219142c937562f2ff8e083be2a2b25b20199e)

@rust-timer

This comment has been minimized.

@lqd

lqd commented Aug 21, 2026

Copy link
Copy Markdown
Member

(check out #141325 if you like bitsets and want to push this one to completion)

@panstromek

Copy link
Copy Markdown
Contributor Author

Yes, I've that one in mind, too (as well as the other 2-3 bitset experiments since then). I'm trying to enable that with slightly different approach to avoid internal branching in #161345 and #161454, but it's still very WIP

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (43bc7f3): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

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

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 2.6%, secondary 3.1%)

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

mean range count
Regressions ❌
(primary)
2.6% [1.8%, 3.5%] 2
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.6% [1.8%, 3.5%] 2

Cycles

Results (secondary -0.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)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.7% [-3.4%, -2.0%] 2
All ❌✅ (primary) - - 0

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 470.067s -> 468.269s (-0.38%)
Artifact size: 400.02 MiB -> 400.11 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Aug 21, 2026
@panstromek
panstromek marked this pull request as ready for review August 21, 2026 20:31
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2026
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 21, 2026
@rustbot

rustbot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

r? @folkertdev

rustbot has assigned @folkertdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: borrowck, compiler
  • borrowck, compiler expanded to 75 candidates
  • Random selection from 21 candidates

@folkertdev

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 823b923 has been approved by folkertdev

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 Aug 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
…use-data, r=folkertdev

Use bitset for locals_with_use_data

There seems to be very little reason to use Vec of bools, the whole map allocates space for every element anyway.

Not sure how is impactful this is, I noticed it randomly in the code, but this seems like cleaner way to do it (and more common in the compiler codebase)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
…use-data, r=folkertdev

Use bitset for locals_with_use_data

There seems to be very little reason to use Vec of bools, the whole map allocates space for every element anyway.

Not sure how is impactful this is, I noticed it randomly in the code, but this seems like cleaner way to do it (and more common in the compiler codebase)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 21, 2026
…use-data, r=folkertdev

Use bitset for locals_with_use_data

There seems to be very little reason to use Vec of bools, the whole map allocates space for every element anyway.

Not sure how is impactful this is, I noticed it randomly in the code, but this seems like cleaner way to do it (and more common in the compiler codebase)
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.

5 participants