Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coregx/coregex
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.12.19
Choose a base ref
...
head repository: coregx/coregex
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.12.20
Choose a head ref
  • 2 commits
  • 27 files changed
  • 1 contributor

Commits on Mar 25, 2026

  1. perf: v0.12.20 — premultiplied StateIDs, break-at-match, Phase 3 elim…

    …ination
    
    DFA Core — Premultiplied + Tagged StateIDs:
    - StateID stores byte offset into flatTrans, eliminating multiply from hot loop
    - Match/dead/invalid flags encoded in StateID high bits (single IsTagged branch)
    - 4x loop unrolling in searchFirstAt, searchAt, searchEarliestMatch
    - safeOffset eliminated from all DFA search paths
    
    DFA Core — Rust-aligned Determinize:
    - 1-byte match delay (Rust determinize mod.rs:254-286)
    - Break-at-match: stop NFA iteration at Match state, drop prefix restarts
    - Epsilon closure rewrite: add-on-pop DFS with reverse Split push order,
      matching Rust sparse set insertion order (verified via cargo run)
    - Incremental per-target epsilon closure in moveWithWordContext
    - filterStatesAfterMatch removed (replaced by break-at-match)
    - BreakAtMatch config: true for forward DFA, false for reverse DFA
    - Phase 3 (SearchAtAnchored re-scan) eliminated — 2-pass bidirectional DFA
    - Fix: meta dfaConfig uses DefaultConfig() to inherit BreakAtMatch=true
    
    Meta Engine:
    - DFA direct FindAll path — skip meta prefilter layer, call DFA directly
    - Fast path for start-anchored FindAll — skip pool overhead
    - Inline first-byte rejection for anchored patterns
    - Prefilter candidate pass-through to bidirectional DFA
    - Skip reverse DFA for always-anchored patterns
    
    NFA/PikeVM:
    - Lazy SlotTable init — reduce cold start overhead
    - Fix anchored BoundedBacktracker on large input — truncate to MaxInputSize
    
    Prefilter:
    - Memmem: Memchr(rareByte) + verify (Rust approach) — replaces MemchrPair
    
    Benchmarks (EPYC CI, 6MB input, vs stdlib / vs Rust):
    - ip: 675x faster than stdlib, 18.5x faster than Rust
    - multiline_php: 288x faster than stdlib, 2.0x faster than Rust
    - char_class: 11x faster than stdlib, 1.3x faster than Rust
    - inner_literal: 668x faster than stdlib, at Rust parity
    - email: 506x faster than stdlib
    - LangArena total: 30x faster than stdlib, 3.9x gap vs Rust
    
    27 files changed, +734 -583 lines. All tests pass.
    kolkov committed Mar 25, 2026
    Configuration menu
    Copy the full SHA
    d22c05c View commit details
    Browse the repository at this point in the history
  2. Merge pull request #154 from coregx/release/v0.12.20

    perf: v0.12.20 — premultiplied StateIDs, break-at-match
    kolkov authored Mar 25, 2026
    Configuration menu
    Copy the full SHA
    90d77fd View commit details
    Browse the repository at this point in the history
Loading