Skip to main content

Module cache

Module cache 

Source
Expand description

Content-addressed DFA compilation cache (skip the pipeline on repeat calls). Content-addressed DFA compilation cache for dfa_assemble.

First compile of a pattern set walks regex_to_nfa โ†’ nfa_to_dfa โ†’ dfa_minimize โ†’ dfa_pack. The second compile with the same patterns skips everything and reads the packed bytes back from the cache.

Cache key: blake3(vyre_std_version + pattern_bytes + options_bytes). Default cache dir: ${XDG_CACHE_HOME:-~/.cache}/vyre/dfa/.

Disable via VYRE_NO_CACHE=1.

Functionsยง

cache_path
Compute the content-addressed cache path for a pattern set + options.
clear
Clear every *.vdfa entry in the cache directory.
load_or_compute
Load a cached PackedDfa, or compute and persist one if missing.
size
Total size of the cache in bytes (sum over all *.vdfa files).