Skip to content
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

[perf experiment] try const dispatch instead of macros for slice::iter::next #136718

Closed
wants to merge 1 commit into from

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Feb 7, 2025

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Feb 7, 2025

r? @Amanieu

rustbot has assigned @Amanieu.
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 S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 7, 2025
@the8472
Copy link
Member Author

the8472 commented Feb 7, 2025

@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 7, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2025
…=<try>

[perf experiment] try const dispatch instead of macros for slice::iter::next
@bors
Copy link
Contributor

bors commented Feb 7, 2025

⌛ Trying commit 505e294 with merge dac6212...

@bors
Copy link
Contributor

bors commented Feb 8, 2025

☀️ Try build successful - checks-actions
Build commit: dac6212 (dac621274200ca2721505796b8d62f81cc2316c2)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (dac6212): comparison URL.

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

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 the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
1.1% [0.3%, 3.5%] 4
Regressions ❌
(secondary)
0.4% [0.3%, 0.4%] 3
Improvements ✅
(primary)
-0.6% [-0.8%, -0.3%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-0.8%, 3.5%] 6

Max RSS (memory usage)

Results (primary -0.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)
3.5% [0.9%, 4.9%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.9% [-4.4%, -1.7%] 5
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.5% [-4.4%, 4.9%] 8

Cycles

Results (primary 1.2%, secondary 1.8%)

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)
3.3% [3.3%, 3.3%] 1
Regressions ❌
(secondary)
1.8% [1.8%, 1.8%] 1
Improvements ✅
(primary)
-0.9% [-0.9%, -0.9%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.2% [-0.9%, 3.3%] 2

Binary size

Results (primary 0.1%, secondary -0.3%)

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.4%] 38
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.1% [-0.2%, -0.0%] 16
Improvements ✅
(secondary)
-0.3% [-1.1%, -0.0%] 4
All ❌✅ (primary) 0.1% [-0.2%, 0.4%] 54

Bootstrap: 778.956s -> 779.107s (0.02%)
Artifact size: 329.06 MiB -> 328.99 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 Feb 8, 2025
@saethlin
Copy link
Member

saethlin commented Feb 8, 2025

Perf looks like usual inliner churn. It would be cool if this were a clean win but I don't think the result indicates it's a loss.

Do we get the desired MIR inlining now?

@the8472
Copy link
Member Author

the8472 commented Feb 8, 2025

A good point, should have checked. We don't.

fn slice_iter(_1: &mut std::slice::Iter<'_, usize>) -> Option<&usize> {
    debug it => _1;
    let mut _0: std::option::Option<&usize>;

    bb0: {
        _0 = <std::slice::Iter<'_, usize> as Iterator>::next(move _1) -> [return: bb1, unwind continue];
    }

    bb1: {
        return;
    }
}

@the8472 the8472 closed this Feb 8, 2025
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-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants