-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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 issues with esbuild #12519
Comments
|
Are you sure that it is actually tsconfck that is blocking? you can run For reference, That being said, It would be great if you could share stats about the size ( number of directories, files, nesting depth) in your project. |
I got different result between running via CLI and in my app (which use nuxt 3) but the size is not that huge from your tests > find . -type f -not -path '.*node_modules/*' | wc -l
7927 Adding async function findAll(dir, options) {
const files = [];
console.time('findAll')
for await (const tsconfigFile of findTSConfig(require$$0$4.resolve(dir), options)) {
files.push(tsconfigFile);
}
console.timeEnd('findAll')
return files;
} gives: But using CLI (without having anything in the stack) has much better results: $ time npx tsconfck@latest find-all .
npx tsconfck@latest find-all . 5.57s user 1.51s system 102% cpu 6.898 total $ time find . -type f -name tsconfig.json
find . -type f -name tsconfig.json 0.03s user 0.06s system 99% cpu 0.096 total I've found this stackoverflow topic that speak about libuv thread pool that might be stuck waiting for other read: https://stackoverflow.com/a/59594320/5303877 -- I'll try to post more info when I found some |
Awesome @dominikg thanks! Also, is it necessary to block |
That is is going to be updated in a different PR. We have to block on it before first transpile though so i'm not sure how much that is going to help. |
Describe the bug
I found that the
vite:esbuild
plugin is taking very long time when project has a lot of directories / content (I mean it can take minutes, tested on WSL2 & Win)vite/packages/vite/src/node/plugins/esbuild.ts
Lines 235 to 237 in 7be0ba5
Can we not await it on resolveConfig hook ?
Why do we need to retrieve all tsconfig on the project?
Reproduction
https://stackblitz.com/edit/vitejs-vite-pruyxz?terminal=dev
Steps to reproduce
It's hard to reproduce, it needs a lot of directory / content.
I can share a private repository to reproduce or adapt https://github.com/stafyniaksacha/nuxt-compos-bench
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: