Expand description
Thread-local pattern compilation cache for ast-grep patterns.
Caches compiled ast-grep patterns to avoid redundant recompilation. Provides 5-10x speedup for repetitive pattern usage. Cache is capped at 256 entries; oldest entries are evicted when full.
Functionsยง
- cache_
size - Get cache statistics for monitoring.
- clear_
cache - Clear the pattern cache (mainly for testing).
- get_
or_ compile_ pattern - Get a compiled pattern from cache, or compile and cache it.