Skip to content

Further optimize SliceIndex<str> impl for Range<usize>#156119

Open
Kmeakin wants to merge 1 commit intorust-lang:mainfrom
Kmeakin:km/optimize-str-index
Open

Further optimize SliceIndex<str> impl for Range<usize>#156119
Kmeakin wants to merge 1 commit intorust-lang:mainfrom
Kmeakin:km/optimize-str-index

Conversation

@Kmeakin
Copy link
Copy Markdown
Contributor

@Kmeakin Kmeakin commented May 3, 2026

We can shave a further 2 icmps by inlining is_char_boundary and rearranging the checks.

Follow up to #145024

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 3, 2026

r? @scottmcm

rustbot has assigned @scottmcm.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @scottmcm, libs
  • @scottmcm, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt, nia-e, scottmcm

@Kmeakin Kmeakin force-pushed the km/optimize-str-index branch from 492232c to 3693b41 Compare May 3, 2026 21:00
@rust-log-analyzer

This comment has been minimized.

@Kmeakin Kmeakin force-pushed the km/optimize-str-index branch from 3693b41 to 04d9b91 Compare May 3, 2026 21:11
@rust-log-analyzer

This comment has been minimized.

We can shave a further 2 `icmp`s by inlining `is_char_boundary` and rearranging
the checks.
@Kmeakin Kmeakin force-pushed the km/optimize-str-index branch from 04d9b91 to ef9eff9 Compare May 3, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. 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.

4 participants