Expand description
Process-wide canonical-path cache.
Keyed by lexical input path; value is the result of
dunce::canonicalize. Hits skip the syscall; misses run it and
cache the result.
The fs-scope security gates that Mountain layers around every
incoming path canonicalise repeatedly during boot: 113 extension
manifest paths, ~80 chunked workbench JS imports, ~60 git-extension
scope checks, every vscode-file:// request. Collapsing repeats to
a hash lookup saves ~150 ms cumulative on the boot path.
time_to_idle = 60s: resets on each access, so hot paths stay
cached indefinitely while one-shot paths evict naturally. Bounds
staleness against external mv / rename.
Modules§
- Cache 🔒
- Process-global canonical-path cache backing store.
- Cache
Stats - Diagnostic snapshot of the canonical-path cache.
- Canonicalize
- Canonicalise via the cache. Returns the cached entry on hit; runs
dunce::canonicalizeon miss and caches the result. - Canonicalize
Uncached - Canonicalise without caching. For one-shot calls where the result is immediately discarded; avoids polluting the cache with paths that will not repeat.
- Clear
- Clear the entire path-canon cache. Diagnostic / shutdown use.
- Invalidate
- Force-evict an entry. Called from
notifywatchers when a path rename is observed inside the workspace, or by the dev-mode hot-reload signal. - Spawn
Diagnostic Logger - Spawn a tokio task that logs cache stats every 30s under the
path-canontarget. Optional - call from the embedder’s runtime setup when the user has thepath-canontag enabled. - Stats
- Capture a diagnostic snapshot of the cache.