#468 Performance: Regex compiled on every call in operators.py and variable_resolver.py

closed medium Created 2025-12-17 01:11 · Updated 2025-12-17 01:56

Description

Edit
Multiple hot-path functions compile regex patterns on every call instead of once: 1. engine/interpreters/operators.py:1137 - wait operation pattern 2. engine/interpreters/variable_resolver.py:207,240 - interpolation patterns FIX: Pre-compile regex patterns at module level as constants: ```python _WAIT_PATTERN = re.compile(r'...') # Module level def function(): match = _WAIT_PATTERN.match(...) # Reuse compiled ```

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...