Skip to main content

FIND_FILES_CACHE_TTL

Constant FIND_FILES_CACHE_TTL 

Source
const FIND_FILES_CACHE_TTL: Duration;
Expand description

Process-wide LRU cache for FindFilesInWorkspace. Cache key folds every input that influences the walk; TTL is short so we never serve a stale result after a file-system mutation. Entry budget is small to bound memory across many workspace folders + glob shapes.

Why: the workbench’s ISearchService fires findFiles per-keystroke during Cmd+P fuzzy match (typically 5-10 calls in 200 ms) AND per breadcrumb / quick-pick refresh. Each walk traverses tens of thousands of files; a 0.5-3 ms HashMap lookup short-circuits all but the first walk in a typing burst.