Inline __iterator_get_unchecked for some iterator adapters.#92566
Inline __iterator_get_unchecked for some iterator adapters.#92566bors merged 2 commits intorust-lang:masterfrom
__iterator_get_unchecked for some iterator adapters.#92566Conversation
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
5bd8a31 to
4f3fafa
Compare
|
The result on the OP looks neat to me, is it worth running a perf-check? |
|
@bors r+ rollup=never |
|
📌 Commit 4f3fafa077a95748cac75f6247eb2ae2fd0cf97c has been approved by |
|
⌛ Testing commit 4f3fafa077a95748cac75f6247eb2ae2fd0cf97c with merge 51205365b7eb58544dcf212d26028dfe2e7a587c... |
|
💔 Test failed - checks-actions |
This comment has been minimized.
This comment has been minimized.
…ed` with those of `next()` on adapters that have both. It improves the performance of iterators using unchecked access when building in incremental mode (due to the larger CGU count?). It might negatively affect incremental compile times for better runtime results, but considering that the equivalent `next()` implementations also are `#[inline]` and usually are more complex this should be ok. ``` ./x.py bench library/core -i --stage 0 --test-args bench_trusted_random_access OLD: 119,172 ns/iter NEW: 17,714 ns/iter ```
|
The bench-executed-as-test overflowed an usize on a 32bit build with overflow checks. It now uses wrapping_add instead to avoid that since the computed results are not relevant to the benchmark, it's just exercising the adapters. I'll go ahead and assume that that fix is tiny enough that doesn't need a new review. @bors r=m-ou-se rollup=never |
|
📌 Commit a68a5d2 has been approved by |
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (3d0ac7e): comparison url. Summary:
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Footnotes |
This aligns the inline attributes of existing
__iterator_get_uncheckedwith those ofnext()on adapters that have both.It improves the performance of iterators using unchecked access when building in incremental mode (due to the larger CGU count?). It might negatively affect incremental compile times for better runtime results, but considering that the equivalent
next()implementations also are#[inline]and usually are more complex this should be ok.