You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regex match performance: ~4x slower than native Perl #1904
The regex benchmark (dev/bench/benchmark_regex.pl) running $i =~ /42/ in a tight loop shows PerlOnJava at ~10,453 iterations/s vs native Perl at ~39,683/s — a 3.8x performance gap.
Analysis
Async-profiler reveals the Joni regex engine itself accounts for only ~2% of CPU. The overhead is dominated by per-match ceremony in the runtime plumbing:
ThreadLocal operations: ~21 per match (save/restore package, debug mode, warning state, source lifecycle)
Object allocations: ~10 per match (RuntimeList, Region, Matcher, ResolvedRegex)
Redundant calls: resolveRegex called twice, emitWarningsOnUse reads 4 ThreadLocals even when the warnings list is empty
Activity
fglock commentedon Oct 27, 2026
The 2x speedup is delivered in PR #1905 (rounds 1-3). Follow-up issue #1907 tracks closing the remaining 1.8x gap to native Perl.
fglock commentedon Oct 27, 2026
Resolved by PR #1905 — regex hot-path optimizations achieving ~2.1x throughput improvement (10,453/s → 22,100/s). Remaining ~1.8x gap to native Perl parity tracked in #1907.