Skip to content

[perf] Add explicit Iterator::count impl for ChunkBy.#158866

Draft
obi1kenobi wants to merge 1 commit into
rust-lang:mainfrom
obi1kenobi:pg/iterator-chunk-by
Draft

[perf] Add explicit Iterator::count impl for ChunkBy.#158866
obi1kenobi wants to merge 1 commit into
rust-lang:mainfrom
obi1kenobi:pg/iterator-chunk-by

Conversation

@obi1kenobi

Copy link
Copy Markdown
Member

TODO: fill out description if perf is improved

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 6, 2026
@obi1kenobi

Copy link
Copy Markdown
Member Author

cc @Kobzol for perf run

@lqd

lqd commented Jul 6, 2026

Copy link
Copy Markdown
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 Jul 6, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 6, 2026
[perf] Add explicit `Iterator::count` impl for `ChunkBy`.
@rust-bors

rust-bors Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 546c6e5 (546c6e543ac3ec8f80e058d5494d0d388854d0d4)
Base parent: 3c00c96 (3c00c96d3af4d5b5e101e56cc161a608b21366ee)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (546c6e5): comparison URL.

Overall result: ❌ regressions - no action needed

Benchmarking means the PR may be perf-sensitive. Consider adding rollup=never if this change is not fit for rolling up.

@rustbot label: -S-waiting-on-perf -perf-regression

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
Regressions ❌
(secondary)
0.7% [0.1%, 1.7%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary -0.7%, secondary -5.2%)

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

Cycles

Results (primary 2.9%, secondary -3.0%)

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

mean range count
Regressions ❌
(primary)
2.9% [2.9%, 2.9%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.4%, -2.6%] 2
All ❌✅ (primary) 2.9% [2.9%, 2.9%] 1

Binary size

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

Bootstrap: 491.018s -> 490.286s (-0.15%)
Artifact size: 388.45 MiB -> 388.95 MiB (0.13%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 7, 2026
@obi1kenobi

Copy link
Copy Markdown
Member Author

It's interesting that we see regressions at all. I expected a ~zero impact finding due to chunk_by not being represented in the benchmark suite. I'll try to triage a bit more, but if someone with more experience cares to look more closely I welcome the help!

@Kobzol

Kobzol commented Jul 7, 2026

Copy link
Copy Markdown
Member

Those two benchmarks are essentially just hello world, it might just be noise, or the stdlib becoming a tiny bit larger to load or something.

A change like this most likely won't be caught by our compile benchmark suite (which doesn't mean it's not worth landing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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