Skip to content

perf(rust): substring search with memchr, split without a string per piece - #92

Merged
kommander merged 1 commit into
devfrom
perf/stack-09-substring
Nov 26, 2026
Merged

kommander merged 1 commit into
devfrom
perf/stack-09-substring

Conversation

@hearnadam

Copy link
Copy Markdown
Contributor

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 under PSYCHOSCRIPT_GC_STRESS=1, and the conformance cases under PSYCHOSCRIPT_ROUNDTRIP=1). Numbers are instructions retired, from rust/bench/examples/corpus and mem_probe (part 1).

@hearnadam
hearnadam added this pull request to stack #95 November 26, 2026 17:17
@hearnadam
hearnadam force-pushed the perf/stack-09-substring branch from 5ecd9e4 to a10b6dd Compare November 26, 2026 17:20
@kommander
kommander force-pushed the perf/stack-09-substring branch 6 times, most recently from 81f4edd to 779442e Compare November 26, 2026 22:55
Base automatically changed from perf/stack-08-tofixed to dev November 26, 2026 22:56
…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
kommander force-pushed the perf/stack-09-substring branch from 779442e to 2d03d5b Compare November 26, 2026 22:57
@kommander
kommander merged commit 4868408 into dev Nov 26, 2026
1 check passed
@kommander
kommander deleted the perf/stack-09-substring branch November 26, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants