Skip to content

Bump mojo-regex to 0.10.0#254

Merged
carolinefrasca merged 18 commits intomodular:mainfrom
msaelices:regex-0.10.0-bump
Apr 13, 2026
Merged

Bump mojo-regex to 0.10.0#254
carolinefrasca merged 18 commits intomodular:mainfrom
msaelices:regex-0.10.0-bump

Conversation

@msaelices
Copy link
Copy Markdown
Contributor

@msaelices msaelices commented Apr 11, 2026

Bumps mojo-regex from 0.9.0 to 0.10.0. Performance tuning release . Mojo vs Rust win rate improved from 57% to 64%.

Changes since 0.9.0 (all in msaelices/mojo-regex):

  • #93: SIMD range comparison for contiguous byte ranges. range_lowercase 9.4x faster than Python.
  • #94: DFA inner-loop optimization. 1.3-1.8x faster on DFA-heavy findall.
  • #95: StringSlice text parameter through the matcher chain. ~11% average speedup.
  • #98: NFAMatcher lazy DFA initialization fix (init_pointee_move).
  • #99: StringSlice pattern parameter + hash-keyed regex cache.
  • #102: Inline NFA per-character range checks (Dict lookup removal).
  • #103: Implement re.sub() for regex pattern substitution.
  • #104: Precompute range classification tag on ASTNode. Net -14% code in nfa.mojo.
  • #105: Eliminate per-match String copies in DFA/NFA hot paths.
  • #106: Add sub() comparison benchmarks. vs Python: 5/5 wins (1.2x-9.0x faster).
  • #108: Capture group extraction and \1..`\9interpolation insub()`.
  • #110: DFA fast path for sub() on fixed-width \d{N} capture groups. Skips NFA entirely, computes group boundaries via pointer arithmetic. Beats Python 2.8-3.2x and Rust 1.5-1.9x on phone number formatting.

Recipe changes:

  • version: 0.9.0 -> 0.10.0
  • rev: pinned to 127c69fe93981221d88a4ec8264265c901ad3221 (current main HEAD).

Updates the pinned rev to cbfdabc (msaelices/mojo-regex#98) so that
the 0.10.0 release shipped through modular-community includes the
`init_pointee_move` fix on `NFAMatcher`'s lazy DFA allocation. The
previous rev (8e56a946) was main HEAD at the 0.10.0 version bump,
before that fix landed.
@msaelices
Copy link
Copy Markdown
Contributor Author

Bumped the pinned rev to include msaelices/mojo-regex#98 (fix for a broken `ptr[] = value` init pattern in `NFAMatcher`'s lazy DFA allocation). The fix needs to be in 0.10.0 since it is a latent double-free introduced in 0.9.x's lazy DFA work and is the kind of thing that only bites at allocator-layout quirks.

Recipe now pins `rev: cbfdabc07804eccce24b19277b482072c6b969a1`.

Includes PR modular#99 (StringSlice pattern in public API with hash-keyed
cache) and the CHANGELOG entry for PRs modular#98 and modular#99 in the 0.10.0
section. New pin: 6a8a0bd (main HEAD).
@msaelices
Copy link
Copy Markdown
Contributor Author

Bumped the pinned rev again to include msaelices/mojo-regex#99 (hash-keyed regex cache, pattern: StringSlice in the public API) and the updated CHANGELOG entry documenting both #98 and #99 under v0.10.0.

New pin: `rev: 6a8a0bd0e793527c5fc5acab881825b95a5da36b` (mojo-regex main HEAD).

@carolinefrasca carolinefrasca merged commit 81f7933 into modular:main Apr 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants