Skip to content

Experiment with lazy allocation for empty DenseBitSet storage - #157024

Closed
Jamesbarford wants to merge 5 commits into
rust-lang:mainfrom
Jamesbarford:experiment/bitset-perf
Closed

Jamesbarford wants to merge 5 commits into
rust-lang:mainfrom
Jamesbarford:experiment/bitset-perf

Conversation

@Jamesbarford

@Jamesbarford Jamesbarford commented May 27, 2026 •

Copy link
Copy Markdown
Contributor

View all comments

Looking at; #141325 and seeing what impact a naive implementation of lazily instantiating the Vector backed storage has on performance.

r? @ghost

@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 May 27, 2026
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

@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 May 27, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request May 27, 2026
Experiment with lazy allocation for empty DenseBitSet storage
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-bors Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4731326 (473132651821eed122d82a410428d80aa10a47fa, parent: ddc1a64229890506f57bae5b270f9e5f604294ec)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (4731326): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@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.2% [0.1%, 0.3%] 8
Regressions ❌
(secondary)
0.4% [0.2%, 1.0%] 14
Improvements ✅
(primary)
-0.3% [-0.4%, -0.2%] 6
Improvements ✅
(secondary)
-0.2% [-0.4%, -0.0%] 17
All ❌✅ (primary) -0.0% [-0.4%, 0.3%] 14

Max RSS (memory usage)

Results (primary -2.3%, secondary -5.7%)

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)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-5.7% [-5.7%, -5.7%] 1
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

Cycles

Results (primary 2.5%)

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

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

Binary size

Results (secondary 0.0%)

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.0% [0.0%, 0.0%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Bootstrap: 510.991s -> 512.432s (0.28%)
Artifact size: 400.76 MiB -> 400.67 MiB (-0.02%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 27, 2026
@Jamesbarford
Jamesbarford force-pushed the experiment/bitset-perf branch from ac283ed to 3799701 Compare June 10, 2026 12:22
@rust-log-analyzer

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the experiment/bitset-perf branch from 3799701 to b8be5c3 Compare June 10, 2026 14:18
@Jamesbarford

Copy link
Copy Markdown
Contributor 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 Jun 11, 2026
Experiment with lazy allocation for empty DenseBitSet storage
@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2026
@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 179987b (179987b8ab7e8e221056f70e19468f1fc6c86bbf, parent: 485ec3fbcc12fa14ef6596dabb125ad710499c9e)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (179987b): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@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.5% [0.1%, 0.9%] 34
Regressions ❌
(secondary)
0.5% [0.1%, 1.4%] 36
Improvements ✅
(primary)
-0.4% [-0.7%, -0.2%] 5
Improvements ✅
(secondary)
-0.6% [-0.9%, -0.2%] 11
All ❌✅ (primary) 0.4% [-0.7%, 0.9%] 39

Max RSS (memory usage)

Results (primary -1.9%, secondary 1.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)
2.3% [1.9%, 2.6%] 4
Improvements ✅
(primary)
-1.9% [-2.9%, -0.9%] 2
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) -1.9% [-2.9%, -0.9%] 2

Cycles

Results (primary 2.3%, 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)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
1.9% [1.9%, 1.9%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-3.7%, -3.7%] 1
All ❌✅ (primary) 2.3% [2.3%, 2.3%] 1

Binary size

Results (primary -0.1%, secondary -0.1%)

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.1% [-0.1%, -0.0%] 56
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.0%] 24
All ❌✅ (primary) -0.1% [-0.1%, -0.0%] 56

Bootstrap: 517.006s -> 517.556s (0.11%)
Artifact size: 401.43 MiB -> 400.83 MiB (-0.15%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2026
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

@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 Jun 11, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
Experiment with lazy allocation for empty DenseBitSet storage
@rust-bors

This comment has been minimized.

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (d6d30fa): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@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.5% [0.1%, 1.1%] 23
Regressions ❌
(secondary)
0.7% [0.3%, 1.3%] 22
Improvements ✅
(primary)
-0.5% [-1.1%, -0.2%] 11
Improvements ✅
(secondary)
-0.6% [-1.9%, -0.2%] 31
All ❌✅ (primary) 0.2% [-1.1%, 1.1%] 34

Max RSS (memory usage)

Results (primary -2.4%, secondary 0.2%)

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)
1.9% [1.2%, 2.5%] 2
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 2
Improvements ✅
(secondary)
-1.6% [-1.8%, -1.3%] 2
All ❌✅ (primary) -2.4% [-2.4%, -2.4%] 2

Cycles

Results (secondary -4.7%)

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)
-4.7% [-4.7%, -4.7%] 1
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 518.142s -> 539.371s (4.10%)
Artifact size: 400.91 MiB -> 401.53 MiB (0.15%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2026
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

@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 Jun 11, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 11, 2026
Experiment with lazy allocation for empty DenseBitSet storage
@rust-bors

rust-bors Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 82680c4 (82680c4289d4b656a82bb1f5cc146a7587118b57, parent: d2f24127d97d8c795d1cf5fbf6037f9885f34d39)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (82680c4): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@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.5% [0.2%, 1.1%] 23
Regressions ❌
(secondary)
0.7% [0.2%, 1.3%] 22
Improvements ✅
(primary)
-0.4% [-1.1%, -0.2%] 11
Improvements ✅
(secondary)
-0.6% [-1.9%, -0.2%] 31
All ❌✅ (primary) 0.2% [-1.1%, 1.1%] 34

Max RSS (memory usage)

Results (primary 1.3%, secondary -0.6%)

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

mean range count
Regressions ❌
(primary)
5.0% [5.0%, 5.0%] 1
Regressions ❌
(secondary)
1.3% [1.3%, 1.3%] 1
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
-1.5% [-1.7%, -1.4%] 2
All ❌✅ (primary) 1.3% [-2.5%, 5.0%] 2

Cycles

Results (primary 1.9%, 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)
1.9% [1.7%, 2.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 1.9% [1.7%, 2.1%] 2

Binary size

Results (secondary -0.0%)

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)
-0.0% [-0.0%, -0.0%] 1
All ❌✅ (primary) - - 0

Bootstrap: 518.142s -> 518.044s (-0.02%)
Artifact size: 400.91 MiB -> 401.53 MiB (0.15%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 11, 2026
@rust-bors

This comment has been minimized.

@Jamesbarford
Jamesbarford force-pushed the experiment/bitset-perf branch from 71af2e0 to 4c77902 Compare November 3, 2026 17:21
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
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 Nov 3, 2026
@rust-bors

rust-bors Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

⌛ Trying commit 4c77902 with merge f9b2efb…

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/41683579227

rust-bors Bot pushed a commit that referenced this pull request Nov 3, 2026
Experiment with lazy allocation for empty DenseBitSet storage
@Jamesbarford

Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rust-bors

rust-bors Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Try build cancelled. Cancelled workflows:

Hint: if you want to run another try build, you do not need to manually cancel the previous one. Just run @bors try and bors will cancel the previous build automatically.

@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 Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-perf Status: Waiting on a perf run to be completed. 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.

4 participants