Skip to main content

get_or_compile_pattern

Function get_or_compile_pattern 

Source
pub fn get_or_compile_pattern(pattern_str: &str, lang: SupportLang) -> Pattern
Expand description

Get a compiled pattern from cache, or compile and cache it.

Patterns are cached thread-locally, capped at 256 entries. When the cap is reached, the cache is cleared and rebuilt on demand. Cache hits provide ~10x speedup over recompilation.