Repository navigation
perf(rust): substring search with memchr, split without a string per piece - #92
Merged
Merged
Conversation
hearnadam
force-pushed
the
perf/stack-09-substring
branch
from
November 26, 2026 17:20
5ecd9e4 to
a10b6dd
Compare
kommander
force-pushed
the
perf/stack-09-substring
branch
6 times, most recently
from
November 26, 2026 22:55
81f4edd to
779442e
Compare
…piece includes, indexOf, split and string replace set up the standard library's two-way searcher on every call. They use memchr::memmem, already in the tree through regress and oxc. split copies the text once and puts short pieces in the buffer short strings share (Strings::alloc_str).
kommander
force-pushed
the
perf/stack-09-substring
branch
from
November 26, 2026 22:57
779442e to
2d03d5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
includes, indexOf, split and string replace set up the standard library's
two-way searcher on every call. They use memchr::memmem, already in the tree
through regress and oxc. split copies the text once and puts short pieces in
the buffer short strings share (Strings::alloc_str).
Part 9 of 11 in a stack; based on
perf/stack-08-tofixed. Each part was built, linted and tested on its own (cargo test --release --workspace, the same underPSYCHOSCRIPT_GC_STRESS=1, and the conformance cases underPSYCHOSCRIPT_ROUNDTRIP=1). Numbers are instructions retired, fromrust/bench/examples/corpusandmem_probe(part 1).