Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

coregex v0.7.0 Released - OnePass DFA for 10x Faster Capture Groups #1

kolkov announced in Announcements
Discussion options

coregex v0.7.0 is here!

We are excited to announce coregex v0.7.0 with OnePass DFA optimization for capture group extraction.

What is OnePass DFA?

OnePass DFA is a specialized automaton that can extract capture groups in a single forward pass without backtracking. It works for patterns where at each byte position, there is only one possible transition.

Performance Improvements

Operation PikeVM OnePass Speedup
FindSubmatch ~700 ns 70 ns 10x
IsMatch anchored ~50 ns 27 ns 1.8x
Memory allocations 2-3 0 Zero alloc

Patterns That Benefit

  • Date parsing: (\d+)-(\d+)-(\d+)
  • Key-value: ([a-z]+)=([^;]+)
  • Word pairs: ([a-z]+)\s+([a-z]+)
  • Simple alternations: a(b|c)d

How It Works

coregex automatically detects if a pattern is one-pass compatible and uses the optimized engine. No code changes required!

re := coregex.MustCompile(`(\d+)-(\d+)-(\d+)`)
match := re.FindStringSubmatch("2025-11-28")
// Automatically uses OnePass DFA - 10x faster!

Full Release Notes

https://github.com/coregx/coregex/releases/tag/v0.7.0

Installation

go get github.com/coregx/coregex@v0.7.0

We would love to hear your feedback! Please share your use cases and benchmark results.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /