Skip to content

[experiment] Try to make index vec smaller when possible#157799

Draft
panstromek wants to merge 10 commits into
rust-lang:mainfrom
panstromek:try-to-make-index-vec-smaller
Draft

[experiment] Try to make index vec smaller when possible#157799
panstromek wants to merge 10 commits into
rust-lang:mainfrom
panstromek:try-to-make-index-vec-smaller

Conversation

@panstromek

@panstromek panstromek commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This is very ugly and unsound, but I want to check CI and perf to see whether there's at least something to gain.

Notes

  • this roundtrips every mutation through vec, which might mask any gains if it's not optimized out properly. I hope I'm gonna see at least some change to see whether it's worth cleaning up.

TODO

  • not sure about Dyn[Send|Sync]
  • Why I had to change the lifetimes in ProjectedMaybeOwner? (Failed in borrowck in rustc_middle)
  • proper desc
  • proper commits

@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 Jun 12, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@panstromek

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

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 12, 2026
…try>

[experiment] Try to make index vec smaller when possible
@rust-bors

rust-bors Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 76803df (76803df0625aa385701a24c186e4526355371fd5, parent: a1e52fc1cf67929a7c01ed9c037520e276ec98fd)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (76803df): 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.4% [0.2%, 0.7%] 155
Regressions ❌
(secondary)
0.4% [0.1%, 1.0%] 107
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.9%, -0.4%] 7
All ❌✅ (primary) 0.4% [0.2%, 0.7%] 155

Max RSS (memory usage)

Results (primary -0.9%, secondary -1.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)
- - 0
Improvements ✅
(primary)
-0.9% [-1.0%, -0.8%] 4
Improvements ✅
(secondary)
-1.2% [-2.0%, -0.3%] 2
All ❌✅ (primary) -0.9% [-1.0%, -0.8%] 4

Cycles

Results (primary 2.2%)

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

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

Binary size

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

Bootstrap: 519.113s -> 519.594s (0.09%)
Artifact size: 400.82 MiB -> 400.82 MiB (-0.00%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 12, 2026
@panstromek

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.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 14, 2026
rust-bors Bot pushed a commit that referenced this pull request Jun 14, 2026
…try>

[experiment] Try to make index vec smaller when possible
@rust-bors

rust-bors Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: e8c5fee (e8c5feedca5bbedf67ca37e9d86d33007371e1f6, parent: 1f087276ba7a16d74ec04739ecf582ae495b3b79)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (e8c5fee): 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.4% [0.2%, 0.7%] 162
Regressions ❌
(secondary)
0.4% [0.2%, 0.8%] 118
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.5% [-0.9%, -0.4%] 7
All ❌✅ (primary) 0.4% [0.2%, 0.7%] 162

Max RSS (memory usage)

Results (primary -0.9%, secondary -1.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)
- - 0
Improvements ✅
(primary)
-0.9% [-1.7%, -0.5%] 8
Improvements ✅
(secondary)
-1.9% [-2.0%, -1.8%] 5
All ❌✅ (primary) -0.9% [-1.7%, -0.5%] 8

Cycles

Results (secondary 3.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)
3.0% [2.2%, 4.1%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 526.872s -> 519.342s (-1.43%)
Artifact size: 401.48 MiB -> 400.98 MiB (-0.12%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 14, 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-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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants