Skip to content

Comments

Neon fast path for str::contains#152176

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
JamieCunliffe:neon-str-contains
Feb 24, 2026
Merged

Neon fast path for str::contains#152176
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
JamieCunliffe:neon-str-contains

Conversation

@JamieCunliffe
Copy link
Contributor

Using the SIMD friendly version of the function also gives a decent speed up with Neon.

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

rustbot commented Feb 5, 2026

r? @jhpratt

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

@jhpratt
Copy link
Member

jhpratt commented Feb 7, 2026

I can't vouch for correctness.

@rustbot reroll

@rustbot rustbot assigned Mark-Simulacrum and unassigned jhpratt Feb 7, 2026
@Mark-Simulacrum
Copy link
Member

decent speed up with Neon.

How do you know? Did we run benchmarks (can you provide the results)?

@Mark-Simulacrum Mark-Simulacrum 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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2026
@JamieCunliffe
Copy link
Contributor Author

I didn't see any benchmarks for this in tree but I did write a few quick ones, something such as:

let data = "Lorem ipsum dolor sit amet";
c.bench_function("amet", |b| b.iter(|| black_box("amet".is_contained_in(&data))));

Nightly: [41.489 ns 41.512 ns 41.534 ns]
This change: [10.610 ns 10.611 ns 10.613 ns]

@davidtwco davidtwco 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 23, 2026
@Mark-Simulacrum Mark-Simulacrum added the relnotes-perf Performance improvements that should be mentioned in the release notes. label Feb 24, 2026
@Mark-Simulacrum
Copy link
Member

Seems like a reasonable result. Thanks for checking!

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 24, 2026

📌 Commit 011d95b has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@rust-bors rust-bors bot 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 24, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 24, 2026
…=Mark-Simulacrum

Neon fast path for str::contains

Using the SIMD friendly version of the function also gives a decent speed up with Neon.
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 24, 2026
…=Mark-Simulacrum

Neon fast path for str::contains

Using the SIMD friendly version of the function also gives a decent speed up with Neon.
rust-bors bot pushed a commit that referenced this pull request Feb 24, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #152176 (Neon fast path for str::contains)
 - #152657 (std: move `exit` out of PAL)
 - #152841 (Streamline `QueryVTableUnerased` into `GetQueryVTable`)
 - #152845 (Skip `tidy` in PR CI jobs not dedicated to running `tidy`)
 - #152897 (Add optional json logging)
 - #153009 (Remove `rustc_feedable_queries` and `define_feedable` macros.)
 - #151558 (Port diagnostic attributes)
 - #152492 (mGCA: Enforce WF element types for array valtrees)
 - #152888 (Fix async drop glue MIR bug)
 - #152988 (Port `#[register_tool]` to the new attribute system)
 - #153018 (`unused_must_use` lint improvements)
 - #153023 (Update books)
 - #153033 (Clarify how "ensure" queries check whether they can skip execution)
 - #153043 (fix error on missing value for -C flags)
 - #153045 (rustc-dev-guide subtree update)

Failed merges:

 - #153032 (Fix attribute parser and kind names.)
@rust-bors rust-bors bot merged commit 9f242b1 into rust-lang:main Feb 24, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 24, 2026
rust-timer added a commit that referenced this pull request Feb 24, 2026
Rollup merge of #152176 - JamieCunliffe:neon-str-contains, r=Mark-Simulacrum

Neon fast path for str::contains

Using the SIMD friendly version of the function also gives a decent speed up with Neon.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

relnotes-perf Performance improvements that should be mentioned in the release notes. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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