Further optimize SliceIndex<str> impl for Range<usize>#156119
Conversation
|
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
492232c to
3693b41
Compare
This comment has been minimized.
This comment has been minimized.
3693b41 to
04d9b91
Compare
This comment has been minimized.
This comment has been minimized.
We can shave a further 2 `icmp`s by inlining `is_char_boundary` and rearranging the checks.
04d9b91 to
ef9eff9
Compare
|
I'm leaving libs reviews. |
|
@bors r+ rollup=never |
|
Moving ahead of prioritized but rollup-able PRs @bors p=2 |
|
rolling back priority @bors p=0 |
|
@Mark-Simulacrum Is the reason this is not rollupable perf? Let's measure that |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Further optimize `SliceIndex<str>` impl for `Range<usize>`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (4e4cf03): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (secondary -2.8%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.2%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 514.705s -> 515.168s (0.09%) |
|
The perf improvement looks real to me, but is relatively small The queue is a little large atm so let's do |
…ark-Simulacrum Further optimize `SliceIndex<str>` impl for `Range<usize>` We can shave a further 2 `icmp`s by inlining `is_char_boundary` and rearranging the checks. Follow up to rust-lang#145024
…ark-Simulacrum Further optimize `SliceIndex<str>` impl for `Range<usize>` We can shave a further 2 `icmp`s by inlining `is_char_boundary` and rearranging the checks. Follow up to rust-lang#145024
…uwer Rollup of 10 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #157323 (Document Repeat::last panic behavior) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16)
…uwer Rollup of 10 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #157323 (Document Repeat::last panic behavior) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16)
…ark-Simulacrum Further optimize `SliceIndex<str>` impl for `Range<usize>` We can shave a further 2 `icmp`s by inlining `is_char_boundary` and rearranging the checks. Follow up to rust-lang#145024
…ark-Simulacrum Further optimize `SliceIndex<str>` impl for `Range<usize>` We can shave a further 2 `icmp`s by inlining `is_char_boundary` and rearranging the checks. Follow up to rust-lang#145024
Rollup of 25 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157224 (Manually unroll loop in `str::floor_char_boundary`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157444 (Couple of work product cleanups) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #153513 (Syntactically reject equality predicates) - #155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - #156155 (macros: report unbound metavariables directly) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #156666 (Clarify meaning of ranges in pointer offset docs) - #157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - #157129 (ci: update download-artifact action to v8) - #157169 (triagebot: Update messages to direct changes to appropriate repositories) - #157323 (Document Repeat::last panic behavior) - #157370 (Clarify MaybeUninit::zeroed padding docs) - #157399 (Silence llbc's output by default to prevent rustc's linker output warning) - #157500 (Improve documentation of `align_of` and `Alignment`.) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16) - #157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - #157580 (Importing suggestion reported twice when reporting privacy error) - #157581 (Test fixup)
Rollup of 25 pull requests Successful merges: - #157447 (Move cross crate tests into the appropriate folder) - #145108 (Resolver: Batched Import Resolution) - #156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - #157224 (Manually unroll loop in `str::floor_char_boundary`) - #157289 (Add infallible primitive type lookups to template arg resolver) - #157540 (Cleanup and optimize `render_impls`) - #157444 (Couple of work product cleanups) - #157543 (Reorganize `tests/ui/issues` [5/N]) - #153513 (Syntactically reject equality predicates) - #155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - #156155 (macros: report unbound metavariables directly) - #156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - #156666 (Clarify meaning of ranges in pointer offset docs) - #157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - #157129 (ci: update download-artifact action to v8) - #157169 (triagebot: Update messages to direct changes to appropriate repositories) - #157323 (Document Repeat::last panic behavior) - #157370 (Clarify MaybeUninit::zeroed padding docs) - #157399 (Silence llbc's output by default to prevent rustc's linker output warning) - #157500 (Improve documentation of `align_of` and `Alignment`.) - #157545 (Suggest using comma to separate valid attribute list items) - #157559 (chore: Update annotate-snippets to 0.12.16) - #157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - #157580 (Importing suggestion reported twice when reporting privacy error) - #157581 (Test fixup)
Rollup of 25 pull requests Successful merges: - rust-lang/rust#157447 (Move cross crate tests into the appropriate folder) - rust-lang/rust#145108 (Resolver: Batched Import Resolution) - rust-lang/rust#156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - rust-lang/rust#157224 (Manually unroll loop in `str::floor_char_boundary`) - rust-lang/rust#157289 (Add infallible primitive type lookups to template arg resolver) - rust-lang/rust#157540 (Cleanup and optimize `render_impls`) - rust-lang/rust#157444 (Couple of work product cleanups) - rust-lang/rust#157543 (Reorganize `tests/ui/issues` [5/N]) - rust-lang/rust#153513 (Syntactically reject equality predicates) - rust-lang/rust#155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - rust-lang/rust#156155 (macros: report unbound metavariables directly) - rust-lang/rust#156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - rust-lang/rust#156666 (Clarify meaning of ranges in pointer offset docs) - rust-lang/rust#157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - rust-lang/rust#157129 (ci: update download-artifact action to v8) - rust-lang/rust#157169 (triagebot: Update messages to direct changes to appropriate repositories) - rust-lang/rust#157323 (Document Repeat::last panic behavior) - rust-lang/rust#157370 (Clarify MaybeUninit::zeroed padding docs) - rust-lang/rust#157399 (Silence llbc's output by default to prevent rustc's linker output warning) - rust-lang/rust#157500 (Improve documentation of `align_of` and `Alignment`.) - rust-lang/rust#157545 (Suggest using comma to separate valid attribute list items) - rust-lang/rust#157559 (chore: Update annotate-snippets to 0.12.16) - rust-lang/rust#157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - rust-lang/rust#157580 (Importing suggestion reported twice when reporting privacy error) - rust-lang/rust#157581 (Test fixup)
Rollup of 25 pull requests Successful merges: - rust-lang/rust#157447 (Move cross crate tests into the appropriate folder) - rust-lang/rust#145108 (Resolver: Batched Import Resolution) - rust-lang/rust#156119 (Further optimize `SliceIndex<str>` impl for `Range<usize>`) - rust-lang/rust#157224 (Manually unroll loop in `str::floor_char_boundary`) - rust-lang/rust#157289 (Add infallible primitive type lookups to template arg resolver) - rust-lang/rust#157540 (Cleanup and optimize `render_impls`) - rust-lang/rust#157444 (Couple of work product cleanups) - rust-lang/rust#157543 (Reorganize `tests/ui/issues` [5/N]) - rust-lang/rust#153513 (Syntactically reject equality predicates) - rust-lang/rust#155797 (LineWriter: cap write_vectored newline scan to avoid quadratic write_all_vectored) - rust-lang/rust#156155 (macros: report unbound metavariables directly) - rust-lang/rust#156188 (riscv: promote d, e, and f target_features to CfgStableToggleUnstable) - rust-lang/rust#156666 (Clarify meaning of ranges in pointer offset docs) - rust-lang/rust#157078 (Document equivalence of `highest_one` and `ilog2` methods on integers) - rust-lang/rust#157129 (ci: update download-artifact action to v8) - rust-lang/rust#157169 (triagebot: Update messages to direct changes to appropriate repositories) - rust-lang/rust#157323 (Document Repeat::last panic behavior) - rust-lang/rust#157370 (Clarify MaybeUninit::zeroed padding docs) - rust-lang/rust#157399 (Silence llbc's output by default to prevent rustc's linker output warning) - rust-lang/rust#157500 (Improve documentation of `align_of` and `Alignment`.) - rust-lang/rust#157545 (Suggest using comma to separate valid attribute list items) - rust-lang/rust#157559 (chore: Update annotate-snippets to 0.12.16) - rust-lang/rust#157560 (In `copy_nonoverlapping`, use `mul nuw nsw` to compute the byte size) - rust-lang/rust#157580 (Importing suggestion reported twice when reporting privacy error) - rust-lang/rust#157581 (Test fixup)
We can shave a further 2
icmps by inliningis_char_boundaryand rearranging the checks.Follow up to #145024