Skip to content

perf(stdlib): memchr scan cores, native str.count - #284

Merged
zaidejjo merged 3 commits into
devfrom
feat/memchr-scans
Oct 7, 2026
Merged

zaidejjo merged 3 commits into
devfrom
feat/memchr-scans

Conversation

@zaidejjo

@zaidejjo zaidejjo commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Phase 3 of the flash plan. Semantics frozen everywhere (probed first, pinned in fixtures).

Changes

  • Rust: str.count via memchr::find_iter — no split temporaries; empty-sub counts chars+1 exactly like the split version it replaces
  • Pure-ZZ split-based count removed (native entry takes over)
  • C: zz_str_count twin + memchr-skip upgrade of contains/find/rfind loops (portable memchr+memcmp, same non-overlap semantics)
  • memchr = "2" direct dep (already in lockfile); lockfile updated
  • Fixture: count edge cases folded into str_find_test (e2e + parity); stdlib.md row added

Verify

  • e2e (VM) ✓, dual-engine parity (VM+AOT) ✓, zz_stdlib lib ✓, clippy + fmt clean

- Rust: str.count via memchr find_iter (no split temporaries; frozen
  edge semantics probed first: empty counts chars+1); find/rfind
  already delegate to memchr-fast std search
- Pure-ZZ split-based count removed (would conflict with native entry)
- C: zz_str_count twin + memchr-skip upgrade for contains/find/rfind
  loops (portable memchr+memcmp, same non-overlap semantics)
- Fixture: count edge cases folded into str_find_test (e2e + parity);
  stdlib.md count row added
@zaidejjo
zaidejjo merged commit d2bc7fa into dev Oct 7, 2026
2 checks passed
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.

1 participant