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

librustdoc: create a helper for separating elements of an iterator instead of implementing it multiple times #136244

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

yotamofek
Copy link
Contributor

@yotamofek yotamofek commented Jan 29, 2025

This implements something similar to Itertools::format, but on Fns returning iterators instead of directly on iterators, to allow implementing Display without the use of a Cell (to handle the possibility of fmt being called multiple times while receiving &self).

This is WIP, I just want to get a perf run first to see if the regression I saw in #135494 is fixed

This was originally part of #135494 , but originally caused a perf regression that was since fixed:

// NOTE: using `Joined::joined` here causes a noticeable perf regression

@rustbot
Copy link
Collaborator

rustbot commented Jan 29, 2025

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
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-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 29, 2025
@GuillaumeGomez
Copy link
Member

Seems very promising, thanks! Please tell me when you want to start the perf run.

@yotamofek
Copy link
Contributor Author

Thanks! I'll ping you once CI checks are done (or can it be queued before they're finished? if so - go ahead please)

@GuillaumeGomez
Copy link
Member

Unfortunately it's not queue, it's done on a separate server. So waiting for your ping then!

@yotamofek
Copy link
Contributor Author

@GuillaumeGomez ping 😁

@GuillaumeGomez
Copy link
Member

Let's go!

@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 Jan 29, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
[WIP: perf] attempt to prevent regressions in that originally happened in rust-lang#135494

This implements something similar to [`Itertools::format`](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.format), but on `Fn`s returning iterators instead of directly on iterators, to allow implementing `Display` without the use of a `Cell` (to handle the possibility of `fmt` being called multiple times while receiving `&self`).

This is WIP, I just want to get a perf run first to see if the regression I saw in rust-lang#135494 is fixed
@bors
Copy link
Contributor

bors commented Jan 29, 2025

⌛ Trying commit 66e29e0 with merge f5cefbb...

@bors
Copy link
Contributor

bors commented Jan 29, 2025

☀️ Try build successful - checks-actions
Build commit: f5cefbb (f5cefbbc06874f3ca9f2ce11fa5610b2fd97780c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f5cefbb): comparison URL.

Overall result: ❌ regressions - 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)
0.8% [0.2%, 1.7%] 6
Regressions ❌
(secondary)
0.2% [0.2%, 0.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.2%, 1.7%] 6

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 775.532s -> 776.62s (0.14%)
Artifact size: 328.40 MiB -> 328.46 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 Jan 29, 2025
@yotamofek
Copy link
Contributor Author

Still regresses 😓
Back to the drawing board...

@GuillaumeGomez
Copy link
Member

Please ping me whenever you want to give it another try. 😉

@yotamofek
Copy link
Contributor Author

Ping 🙏

@GuillaumeGomez
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 Jan 29, 2025
@bors
Copy link
Contributor

bors commented Jan 29, 2025

⌛ Trying commit 63abcb0 with merge e38cd65...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
[WIP: perf] attempt to prevent regressions in that originally happened in rust-lang#135494

This implements something similar to [`Itertools::format`](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.format), but on `Fn`s returning iterators instead of directly on iterators, to allow implementing `Display` without the use of a `Cell` (to handle the possibility of `fmt` being called multiple times while receiving `&self`).

This is WIP, I just want to get a perf run first to see if the regression I saw in rust-lang#135494 is fixed
@bors
Copy link
Contributor

bors commented Jan 29, 2025

☀️ Try build successful - checks-actions
Build commit: e38cd65 (e38cd65d26f9fb9c2e492cc9752f0b6fccffff0f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e38cd65): comparison URL.

Overall result: ❌ regressions - 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)
0.8% [0.2%, 1.6%] 5
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.8% [0.2%, 1.6%] 5

Max RSS (memory usage)

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

Cycles

Results (secondary 9.2%)

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

Binary size

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

Bootstrap: 776.896s -> 776.333s (-0.07%)
Artifact size: 328.47 MiB -> 328.48 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 29, 2025
@GuillaumeGomez
Copy link
Member

Thanks!

@bors r+ rollup=iffy

@bors
Copy link
Contributor

bors commented Feb 3, 2025

📌 Commit eb2635e has been approved by GuillaumeGomez

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 Feb 3, 2025
@bors
Copy link
Contributor

bors commented Feb 4, 2025

☔ The latest upstream changes (presumably #136507) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 4, 2025
@yotamofek yotamofek force-pushed the pr/rustdoc-join-iter branch from eb2635e to cb028dc Compare February 4, 2025 09:09
@yotamofek
Copy link
Contributor Author

@rustbot review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 4, 2025
@fmease

This comment was marked as resolved.

@fmease
Copy link
Member

fmease commented Feb 4, 2025

Lol, oops. @bors r=GuillaumeGomez

@bors
Copy link
Contributor

bors commented Feb 4, 2025

📌 Commit cb028dc has been approved by GuillaumeGomez

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 Feb 4, 2025
@bors
Copy link
Contributor

bors commented Feb 5, 2025

⌛ Testing commit cb028dc with merge 8df89d1...

@bors
Copy link
Contributor

bors commented Feb 5, 2025

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 8df89d1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 5, 2025
@bors bors merged commit 8df89d1 into rust-lang:master Feb 5, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 5, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8df89d1): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.7% [-0.8%, -0.6%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.7% [-0.8%, -0.6%] 2

Max RSS (memory usage)

Results (primary 0.2%)

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

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: 777.31s -> 776.632s (-0.09%)
Artifact size: 328.75 MiB -> 328.78 MiB (0.01%)

@yotamofek yotamofek deleted the pr/rustdoc-join-iter branch February 5, 2025 12:02
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2025
…<try>

librustdoc: more usages of `Joined::joined`

Some missed opportunities from rust-lang#136244
r? `@GuillaumeGomez` since you reviewed the last one (feel free to re-assign, of course 😊)
First two commits are just drive-by cleanups
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 18, 2025
…r=GuillaumeGomez

librustdoc: more usages of `Joined::joined`

Some missed opportunities from rust-lang#136244
r? `@GuillaumeGomez` since you reviewed the last one (feel free to re-assign, of course 😊)
First two commits are just drive-by cleanups
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 18, 2025
…r=GuillaumeGomez

librustdoc: more usages of `Joined::joined`

Some missed opportunities from rust-lang#136244
r? ``@GuillaumeGomez`` since you reviewed the last one (feel free to re-assign, of course 😊)
First two commits are just drive-by cleanups
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Feb 18, 2025
…r=GuillaumeGomez

librustdoc: more usages of `Joined::joined`

Some missed opportunities from rust-lang#136244
r? ```@GuillaumeGomez``` since you reviewed the last one (feel free to re-assign, of course 😊)
First two commits are just drive-by cleanups
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 19, 2025
Rollup merge of rust-lang#136599 - yotamofek:pr/rustdoc-more-joined, r=GuillaumeGomez

librustdoc: more usages of `Joined::joined`

Some missed opportunities from rust-lang#136244
r? ```@GuillaumeGomez``` since you reviewed the last one (feel free to re-assign, of course 😊)
First two commits are just drive-by cleanups
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-rustdoc Relevant to the rustdoc 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