Skip to content

use triomphe::Arc for InternedObligationCauseCode instead of Arc #137135

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Feb 16, 2025

This nicely cuts memory reads (reported by dhat), while marginally reducing maxrss for some stresstest (#125267 (comment)).

Lets see perf?

@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2025

r? @Nadrieril

rustbot has assigned @Nadrieril.
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

@rustbot rustbot added A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 16, 2025
@rustbot
Copy link
Collaborator

rustbot commented Feb 16, 2025

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@Nadrieril
Copy link
Member

@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 Feb 16, 2025
@bors
Copy link
Collaborator

bors commented Feb 16, 2025

⌛ Trying commit b470b56 with merge ee89a51...

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 16, 2025
use triomphe::Arc for InternedObligationCauseCode instead of Arc

This nicely cuts memory reads (reported by dhat), while marginally reducing maxrss for some stresstest.

Lets see perf?
@bors
Copy link
Collaborator

bors commented Feb 16, 2025

☀️ Try build successful - checks-actions
Build commit: ee89a51 (ee89a51b4014bff6890f761267fc68bfaf28ec48)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ee89a51): comparison URL.

Overall result: no relevant changes - 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 benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 1.5%)

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

Cycles

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

Binary size

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

Bootstrap: 790.759s -> 790.962s (0.03%)
Artifact size: 350.03 MiB -> 350.05 MiB (0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Feb 16, 2025
@compiler-errors
Copy link
Member

I personally don't think this justifies changing the impl

@klensy
Copy link
Contributor Author

klensy commented Feb 16, 2025

Very small instructions and maxrss improvement, but can be spurious (with non-relevant checked.), i'll see what can be done.

I personally don't think this justifies changing the impl

Actual change is only one line:

-    code: Option<Arc<ObligationCauseCode<'tcx>>>,
+    code: Option<triomphe::Arc<ObligationCauseCode<'tcx>>>,

all other changes is copy&paste of Arc impls.

@compiler-errors
Copy link
Member

What I mean is relying on an alternative, out-of-tree implementation of Arc for literally minimal perf changes.

@alex-semenyuk
Copy link
Member

alex-semenyuk commented Mar 17, 2025

Triage: comment is not answered and need rebase
@rustbot label: +S-waiting-on-author, -S-waiting-on-review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tidy Area: The tidy tool S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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