Skip to content

Bump mojo-regex to 0.8.0#245

Merged
carolinefrasca merged 4 commits intomodular:mainfrom
msaelices:regex-0.8.0-bump
Apr 2, 2026
Merged

Bump mojo-regex to 0.8.0#245
carolinefrasca merged 4 commits intomodular:mainfrom
msaelices:regex-0.8.0-bump

Conversation

@msaelices
Copy link
Copy Markdown
Contributor

Summary

Bump mojo-regex from 0.7.0 to 0.8.0.

Major performance release. Mojo vs Python win rate improved from 53% to 85% (52 wins, 9 losses out of 61 benchmarks).

Highlights

  • Nibble-based SIMD matching: Character class matching using two 16-byte nibble tables with native pshufb, 29-350x faster than Python for [a-z]+, \d+, \w+
  • is_match O(1) fast path: 2000-19000x faster than Python, 2-6x faster than Rust
  • DFA compiler extensions: Non-capturing alternation groups, variable-length branches, deeply nested groups, capturing group flattening
  • .* prefix/suffix fast paths: Skip NFA backtracking entirely for .*LITERAL and LITERAL.* patterns
  • Parser bug fixes: Escaped characters, dash outside brackets, DFA start state for bounded quantifiers
  • Fair benchmark harness: Pre-compiled regex, median timing, auto-calibration across Mojo/Python/Rust

See full changelog: https://github.com/msaelices/mojo-regex/blob/main/CHANGELOG.md

@carolinefrasca carolinefrasca merged commit 1e46377 into modular:main Apr 2, 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