With isolation enabled tinypool keeps worker count at a minimum
Demivan opened this issue · comments
If isolation is enabled _ensureMinimumWorkers
is called when worker is done. But it only creates a worker if worker count is less then minimum.
Because minimum worker count is half of physical core count right now, this means that Tinypool is using only a quarter of actual PC cores. This is really inefficient. On my 16 core CPU Tinypool is using only 4 cores.
So we've got two solutions now:
1: #22
2: making your quarter of cores into half of them!
Which one do you suggest? For now, two is more appropriate, which can be a bug! and then 1
I think I will add a minThreads/maxThreads override in Vitest for now.
Tinypool just needs a better scheduling for isolated workers. It should keep using available threads.
I think I will add a minThreads/maxThreads override in Vitest for now. Tinypool just needs a better scheduling for isolated workers. It should keep using available threads.
@Demivan Please let's keep Vitest aligned with tinypool! So let's not override, so we can benefit from improvements properly 😄