Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12x faster resolver cache #9984

Merged
merged 14 commits into from
Nov 10, 2024
Merged

12x faster resolver cache #9984

merged 14 commits into from
Nov 10, 2024

Conversation

devongovett
Copy link
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.

@devongovett devongovett merged commit 0467893 into v2 Nov 10, 2024
17 checks passed
@devongovett devongovett deleted the resolver-perf branch November 10, 2024 00:26
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