Skip to content

12x faster resolver cache#9984

Merged
devongovett merged 14 commits into
v2from
resolver-perf
Nov 10, 2024
Merged

12x faster resolver cache#9984
devongovett merged 14 commits into
v2from
resolver-perf

Conversation

@devongovett

Copy link
Copy Markdown
Member

This rewrites the resolver cache to be much more efficient. Instead of storing data in a bunch of separate hash maps, this creates a new CachedPath data structure that stores information about paths in a single place. This includes a direct reference to the parent path, a pre-computed hash of the path, lazily loaded file kind (e.g. file/dir/symlink), canonical path, and parsed package.json/tsconfig.json. CachedPath references this info via an Arc, so it is cheap to compare, hash, and clone compared with a PathBuf. It can also perform common operations like appending a sub-path or file extension cheaply via a reusable thread local scratch path, avoiding intermediary allocations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant