Loading
perf: combine regex patterns for efficient path matching
Summary
Optimize pattern matching in determine_callsite by combining IGNORE_PATHS and wrapper_patterns into a single Regexp.union for efficient matching.
Changes
- Add
combined_ignore_patternclass method that caches the union of all patterns - Invalidate cache when wrapper patterns are added or reset
- Replace two separate
.any?iterations with a singlematch?call
Expected Performance Improvement
- Reduces the number of regex matches from 5+ per frame to 1
- ~5-10% reduction in pattern matching overhead
- The combined pattern is cached and only rebuilt when wrapper patterns change (rare)
Closes: #60 (closed)
Edited by Doug Barrett