-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Pool waits a few seconds before restarting process #45
Comments
Thank you so much, Vladimir, I'll check it out. |
I released 0.3.1, could you check if the problem is still there so I work on it! If not, then the release fixed it and it was the same issue as the isolateWorkers issue. Let me know. |
Still the same |
Ok, I'll put the time, hope I can get you a proper result soon! |
Hey 👋 |
@purepear Hey, Thank you so much for your work! |
Hey @Aslemammad, I noticed some improvements in Vitest 0.28.3 but I can't tell if they are directly related to [email protected]. I put some results in this comment. Regarding this issue, there are 2 things that I noticed:
Here are example results from the first couple of batches of a test run (9 threads in my case).
|
Sure, I see, I do not know what to expect around worker initialization since it is relative, but I'll take a look. Let me know if you want to work on this issue, since you are doing most of the work, and thank you for that. |
Now that I'm reading the original issue again, I think this might actually be an issue that I can't replicate locally. @sheremet-va mentioned "workers don't start for a few seconds after the first four are finished" which might be sth specific to his setup ("few seconds" sounds like a noticeable thing). Aside from that, I'll try to do some investigation into worker initialisation time in the following weeks when I have time. Thanks for the incredible work you are doing! 🙇 |
@purepear Thank you so much, sure, feel free to do so. |
After experimenting for a few days, I found out that for the Second, around the batches, the reason is that the If we do something like this, we see that workers won't wait for each other, and some will start when the worker is done.
For instance, here we'd have two workers running with workerId So the only issue is the initialization cost which is not something that tinypool can handle. Still, one way to improve performance in vitest is to remove imports in the worker file or even delay them or condition them. I'll let this issue open for a while in case someone finds a solution in tinypool! Let me know your opinions. |
I think this is fixed by nodejs/node#51526. Earlier Node had randomly issues when terminating Workers. Tinypool starts new workers only after the previous ones have closed so that max thread count is not exceeded. The root cause for this reported issue could very well be the linked Node issue. Update your Node to |
While debugging #579 (reproduction: https://github.com/purepear/vitest-element-plus-debug, command
npm run vitest-element
), I noticed workers don't start for a few seconds after the first four are finished. I think there might be a bug that causes this performance regression.The text was updated successfully, but these errors were encountered: