#474 Performance: Regex compiled on every call in variable_resolver.py

closed high Created 2025-12-17 01:42 · Updated 2025-12-17 01:45

Description

Edit
engine/interpreters/variable_resolver.py lines 196, 207, 240 Hot path compiles regex patterns on every variable interpolation: - Line 196: re.fullmatch(r'\{\{([^}]+)\}\}', value) - Line 207: re.sub(r'\{\{([^}]+)\}\}', replacer, value) - Line 240: re.split(r'[.\[\]]', path) Impact: HIGH - executed per variable, multiple times per workflow task. FIX: Pre-compile at module level: ```python _VARIABLE_PATTERN = re.compile(r'\{\{([^}]+)\}\}') _PATH_SPLIT_PATTERN = re.compile(r'[.\[\]]') ```

Comments

Loading comments...

Context

Loading context...

Audit History

View All
Loading audit history...