Skip to content

Create an AllocId for ConstValue::Slice. #116707

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 3 commits into from
Jul 24, 2025
Merged

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Oct 13, 2023

This PR modifies ConstValue::Slice to use an AllocId instead of directly manipulating the allocation. This was originally proposed by #115764 but was a perf regression.

Almost 2 years later, enough code has changed to make this a perf improvement: #116707 (comment)

@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 Oct 13, 2023
@cjgillot
Copy link
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 Oct 13, 2023
@bors
Copy link
Collaborator

bors commented Oct 13, 2023

⌛ Trying commit 334753f with merge 9ef21e1...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 13, 2023
Create an `AllocId` for `ConstValue::Slice`.

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Oct 13, 2023

☀️ Try build successful - checks-actions
Build commit: 9ef21e1 (9ef21e1d83c6c9220b072fd1a4f225949514cc28)

@rust-timer

This comment has been minimized.

@RalfJung
Copy link
Member

How does this differ from the almost identical perf experiment I did a few weeks ago? Here are the perf results.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (9ef21e1): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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)
1.7% [1.7%, 1.7%] 1
Regressions ❌
(secondary)
2.5% [0.4%, 7.7%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.2% [-1.3%, -1.0%] 3
All ❌✅ (primary) 1.7% [1.7%, 1.7%] 1

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)
1.5% [0.9%, 2.2%] 3
Regressions ❌
(secondary)
3.8% [0.8%, 14.5%] 17
Improvements ✅
(primary)
-1.6% [-1.6%, -1.6%] 1
Improvements ✅
(secondary)
-5.3% [-10.2%, -0.9%] 16
All ❌✅ (primary) 0.7% [-1.6%, 2.2%] 4

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)
7.0% [2.1%, 21.5%] 14
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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.1% [0.0%, 0.3%] 30
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 9
Improvements ✅
(primary)
-0.0% [-0.1%, -0.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.3%] 33

Bootstrap: 628.692s -> 625.904s (-0.44%)
Artifact size: 271.29 MiB -> 271.29 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 Oct 14, 2023
@cjgillot
Copy link
Contributor Author

No real difference. I just couldn't find your version.
Now there is one.

@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 Oct 14, 2023
@bors
Copy link
Collaborator

bors commented Oct 14, 2023

⌛ Trying commit e195fe8 with merge eafbd55...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 14, 2023
Create an `AllocId` for `ConstValue::Slice`.

r? `@ghost`
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Oct 14, 2023

☀️ Try build successful - checks-actions
Build commit: eafbd55 (eafbd55f7123e31b30c2f3224a91d6db75e48c3f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (eafbd55): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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.6% [0.1%, 1.8%] 4
Regressions ❌
(secondary)
1.7% [0.2%, 7.8%] 12
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.1% [-1.2%, -1.0%] 3
All ❌✅ (primary) 0.6% [0.1%, 1.8%] 4

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)
1.6% [1.2%, 2.1%] 3
Regressions ❌
(secondary)
2.9% [1.1%, 8.7%] 15
Improvements ✅
(primary)
-1.9% [-3.3%, -0.5%] 2
Improvements ✅
(secondary)
-6.0% [-9.9%, -1.0%] 19
All ❌✅ (primary) 0.2% [-3.3%, 2.1%] 5

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)
8.0% [2.6%, 13.7%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

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.1% [0.0%, 0.3%] 30
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 9
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.3%] 33

Bootstrap: 627.527s -> 627.366s (-0.03%)
Artifact size: 271.26 MiB -> 271.31 MiB (0.02%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Oct 14, 2023
@Dylan-DPC Dylan-DPC added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2024
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the T-clippy Relevant to the Clippy team. label Jul 13, 2025
@cjgillot
Copy link
Contributor Author

@bors try @rust-timer queue

@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 Jul 18, 2025
@cjgillot
Copy link
Contributor Author

I did not manage to reproduce the test failure.

@RalfJung
Copy link
Member

@bors2 try jobs=aarch64-apple

@rust-bors
Copy link

rust-bors bot commented Jul 20, 2025

⌛ Trying commit b320a80 with merge d743e78

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

rust-bors bot added a commit that referenced this pull request Jul 20, 2025
Create an `AllocId` for `ConstValue::Slice`.

This PR modifies `ConstValue::Slice` to use an `AllocId` instead of directly manipulating the allocation. This was originally proposed by #115764 but was a perf regression.

Almost 2 years later, enough code has changed to make this a perf improvement: #116707 (comment)
try-job: aarch64-apple
@rust-bors
Copy link

rust-bors bot commented Jul 20, 2025

💔 Test failed

@RalfJung
Copy link
Member

Seems like it reproduces on CI though, so something will have to be done.

These are crash tests. And apparently your PR fixes the crash?

@RalfJung
Copy link
Member

This trivially reproduces for me with ./x test crashes.

@cjgillot
Copy link
Contributor Author

Both failing ICEs have been fixed by #144233, so the CI failure should be gone.

@bors r=oli-obk,RalfJung

@bors
Copy link
Collaborator

bors commented Jul 24, 2025

📌 Commit 967ba2f has been approved by oli-obk,RalfJung

It is now in the queue for this repository.

@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 Jul 24, 2025
@bors
Copy link
Collaborator

bors commented Jul 24, 2025

⌛ Testing commit 967ba2f with merge 3c30dbb...

@bors
Copy link
Collaborator

bors commented Jul 24, 2025

☀️ Test successful - checks-actions
Approved by: oli-obk,RalfJung
Pushing 3c30dbb to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 24, 2025
@bors bors merged commit 3c30dbb into rust-lang:master Jul 24, 2025
12 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 24, 2025
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing efd420c (parent) -> 3c30dbb (this PR)

Test differences

Show 10 test diffs

10 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 3c30dbbe31bfbf6029f4534170165ba573ff0fd1 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. x86_64-apple-2: 4145.6s -> 5546.3s (33.8%)
  2. dist-aarch64-linux: 8295.5s -> 5899.8s (-28.9%)
  3. pr-check-2: 2097.6s -> 2671.2s (27.3%)
  4. dist-x86_64-apple: 8978.6s -> 11237.3s (25.2%)
  5. dist-apple-various: 6670.3s -> 5640.3s (-15.4%)
  6. i686-gnu-1: 7268.7s -> 8189.3s (12.7%)
  7. x86_64-rust-for-linux: 2588.1s -> 2915.1s (12.6%)
  8. i686-gnu-nopt-1: 7174.2s -> 8073.0s (12.5%)
  9. aarch64-gnu-llvm-19-1: 3977.3s -> 3498.8s (-12.0%)
  10. x86_64-gnu-llvm-20-1: 3239.3s -> 3620.8s (11.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3c30dbb): comparison URL.

Overall result: ❌✅ regressions and improvements - please read the text below

Our benchmarks found a performance regression caused by this PR.
This might be an actual regression, but it can also be just noise.

Next Steps:

  • If the regression was expected or you think it can be justified,
    please write a comment with sufficient written justification, and add
    @rustbot label: +perf-regression-triaged to it, to mark the regression as triaged.
  • If you think that you know of a way to resolve the regression, try to create
    a new PR with a fix for the regression.
  • If you do not understand the regression or you think that it is just noise,
    you can ask the @rust-lang/wg-compiler-performance working group for help (members of this group
    were already notified of this PR).

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.7% [0.2%, 1.0%] 6
Regressions ❌
(secondary)
0.3% [0.0%, 0.9%] 38
Improvements ✅
(primary)
-0.3% [-0.6%, -0.1%] 17
Improvements ✅
(secondary)
-1.9% [-10.2%, -0.0%] 56
All ❌✅ (primary) -0.1% [-0.6%, 1.0%] 23

Max RSS (memory usage)

Results (primary 1.9%, secondary -4.0%)

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

mean range count
Regressions ❌
(primary)
1.9% [0.8%, 4.5%] 4
Regressions ❌
(secondary)
4.0% [1.1%, 8.2%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.6% [-11.3%, -1.0%] 30
All ❌✅ (primary) 1.9% [0.8%, 4.5%] 4

Cycles

Results (secondary -7.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)
4.7% [2.9%, 7.8%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-12.1% [-16.8%, -3.8%] 17
All ❌✅ (primary) - - 0

Binary size

Results (primary -0.1%, 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.0% [0.0%, 0.0%] 4
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 15
Improvements ✅
(primary)
-0.1% [-0.1%, -0.0%] 52
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 17
All ❌✅ (primary) -0.1% [-0.1%, 0.0%] 56

Bootstrap: 468.582s -> 468.586s (0.00%)
Artifact size: 374.67 MiB -> 374.68 MiB (0.00%)

@rustbot rustbot added the perf-regression Performance regression. label Jul 24, 2025
@cjgillot cjgillot deleted the slice-id branch July 24, 2025 10:24
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jul 25, 2025
Create an `AllocId` for `ConstValue::Slice`.

This PR modifies `ConstValue::Slice` to use an `AllocId` instead of directly manipulating the allocation. This was originally proposed by rust-lang/rust#115764 but was a perf regression.

Almost 2 years later, enough code has changed to make this a perf improvement: rust-lang/rust#116707 (comment)
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. perf-regression Performance regression. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-clippy Relevant to the Clippy team. 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.

10 participants