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

perf: node resolution cache #27838

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Conversation

dsherret
Copy link
Member

This adds a cache for node resolution, which makes repeat lookups about 15x faster. Additionally, I reduced some allocations by accepting either a pathbuf or url for the referrer for resolution and returning either a pathbuf or url at the end, which the caller can then convert into to their preferred state.

Will update with benchmarks soon... just compiling in release against main.

@@ -4640,6 +4642,7 @@ fn op_resolve_inner(
})
})
.collect();
NodeResolutionThreadLocalCache::clear();
Copy link
Member Author

@dsherret dsherret Jan 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should improve this to be smarter. Right now I just have it clearing before and after each op_resolve.

@dsherret

This comment was marked as outdated.

@dsherret dsherret marked this pull request as draft January 27, 2025 17:50
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