Skip to content

Convert some iter macros to normal functions #124393

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 1 commit into from
Apr 26, 2024

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Apr 26, 2024

With all the MIR optimization changes that have happened since these were written, let's see if they still actually matter.

*perf comes back*

Well, it looks like it's not longer relevant for instruction, cycle, nor wall-time perf. Looks like a bunch of things are maybe 10kb bigger in debug, but one is also 50k smaller in debug.

So I think they should switch to being normal functions as the "greatly improves performance" justification for them being macros seems to no longer be true -- probably thanks to us always building core with -Z inline-mir so the difference is negligible.

With all the MIR optimization changes that have happened since these were written, let's see if they still actually matter.
@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 Apr 26, 2024
@scottmcm
Copy link
Member 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 Apr 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 26, 2024
… r=<try>

Convert some iter macros to normal functions

With all the MIR optimization changes that have happened since these were written, let's see if they still actually matter.

r? ghost
@bors
Copy link
Collaborator

bors commented Apr 26, 2024

⌛ Trying commit cd47a0e with merge 2c1caf5...

@bors
Copy link
Collaborator

bors commented Apr 26, 2024

☀️ Try build successful - checks-actions
Build commit: 2c1caf5 (2c1caf528730eb705b9bd1d8dba09e7c78041701)

1 similar comment
@bors
Copy link
Collaborator

bors commented Apr 26, 2024

☀️ Try build successful - checks-actions
Build commit: 2c1caf5 (2c1caf528730eb705b9bd1d8dba09e7c78041701)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2c1caf5): 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

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.1%, 0.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-2.8%, -2.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -1.4% [-2.8%, 0.1%] 2

Cycles

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

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%] 60
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 7
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.3%] 61

Bootstrap: 670.073s -> 670.802s (0.11%)
Artifact size: 316.00 MiB -> 316.01 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 26, 2024
@scottmcm
Copy link
Member Author

r? libs

@scottmcm scottmcm marked this pull request as ready for review April 26, 2024 10:14
@joboet
Copy link
Member

joboet commented Apr 26, 2024

Fantastic! These macros add so much confusion (at least for me), so it's great that we can remove them.

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 26, 2024

📌 Commit cd47a0e has been approved by joboet

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 Apr 26, 2024
@bors
Copy link
Collaborator

bors commented Apr 26, 2024

⌛ Testing commit cd47a0e with merge 5ff8fbb...

@bors
Copy link
Collaborator

bors commented Apr 26, 2024

☀️ Test successful - checks-actions
Approved by: joboet
Pushing 5ff8fbb to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 26, 2024
@bors bors merged commit 5ff8fbb into rust-lang:master Apr 26, 2024
11 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 26, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5ff8fbb): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

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

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)
3.6% [0.1%, 7.1%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.7% [-4.6%, -2.7%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-4.6%, 7.1%] 4

Cycles

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

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%] 60
Regressions ❌
(secondary)
0.0% [0.0%, 0.1%] 7
Improvements ✅
(primary)
-0.1% [-0.1%, -0.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [-0.1%, 0.3%] 61

Bootstrap: 670.073s -> 670.891s (0.12%)
Artifact size: 316.00 MiB -> 315.98 MiB (-0.01%)

@scottmcm scottmcm deleted the do-the-macros-still-matter branch April 26, 2024 17:10
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. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants