-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
fix: reduce number of fs.realpath
calls
#6412
Conversation
9bda4e2
to
5b75cad
Compare
Just rebased onto |
Are there notes on how caching realpath calls improves perf? Looks like node also implements it's own cache, so I'm curious how another layer of cache helps with this. |
We are using
I'll add some, but the basic idea is to avoid I/O calls as much as possible. |
@Lani stated in this comment:
He's referring to the |
Thanks for the explaination. If I feel like I'm missing a history in nodejs of why |
Maybe a config option to disable
I think this will be relatively painless to maintain, because it isn't doing anything that crazy or unsafe, and we've got some good tests for it already (as well as verbose logs for easier debugging). Though, I'd be okay with publishing it as a separate package that Vite depends on. |
I've found out that |
With the changes in these past weeks for 4.3, it isn't clear that a cache at this level is needed. I think it is an interesting idea though, and maybe we should revisit this PR in the future. Let's close this for now, and we can re-evaluate for Vite 5. |
Description
#6030 reported a performance regression related to
fs.realpath
calls, so I've implemented a cache for symlink resolution. We need some people to test this on bigger projects where the regression is most noticeable. 👀Additional context
Use this plugin to inspect the effectiveness of this approach:
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).