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

fix: 23 #24

Merged
merged 2 commits into from
Feb 8, 2022
Merged

fix: 23 #24

merged 2 commits into from
Feb 8, 2022

Conversation

Aslemammad
Copy link
Member

Fixes #23

@Demivan
Copy link

Demivan commented Feb 8, 2022

This would do the trick, but it is the same fix as I did in Vitest. Would be nice if we don't create threads if there is no work for them in the queue.

@Aslemammad
Copy link
Member Author

@Demivan Well, as you can see in the code, we create new workers based on maxThreads (L853), So I guess it's good! What's your opinion now?

@Aslemammad
Copy link
Member Author

But one thing, we can also make maxThreads = cpuCount (physicalCores) instead of maxThreads = cpuCount * 1.5

@Aslemammad
Copy link
Member Author

So it'd always see the actual capacity instead of 1.5 or 0.5 of it!

@Demivan
Copy link

Demivan commented Feb 8, 2022

@Demivan Well, as you can see in the code, we create new workers based on maxThreads (L853), So I guess it's good! What's your opinion now?

Ah, I see it now. Then we can reuse new code for L853 too. Later it can be improved to add workers only if there is work to do.

@Aslemammad
Copy link
Member Author

Thanks, @Demivan My system is only 4 cores, it's poor enough, could you try and see if it gains you the performance you need?

@Demivan
Copy link

Demivan commented Feb 8, 2022

Yes, there is a performance boost. It now uses 8 of my cores - that is correct for physical cores config.

We still need to pass config to Tinypool in Vitest because we want different config for watch and run. But we no longer need minThreads to be the same as maxThreads.

@Aslemammad
Copy link
Member Author

Ok then, feel free if this PR improves vitest! Let me merge it! Thank you for your excellent work!

@Aslemammad Aslemammad merged commit b640493 into main Feb 8, 2022
@Aslemammad Aslemammad deleted the fix/23 branch February 8, 2022 20:56
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.

With isolation enabled tinypool keeps worker count at a minimum
2 participants