[BUG] Performance degradation when setTimeout / setImmediate is not used in parent test #1017
Open
3 tasks done
Labels
bug
something not go good
Is there an existing issue for this?
Have you read the
CONTRIBUTING
guide on posting bugs, andCODE_OF_CONDUCT
?This issue exists in the latest tap version
Description
When a lot of small CPU-bound async tests are run, tap is really slow (20+ seconds for 3k simple assertions).
Adding a single await for next tick in the beginning of the parent test improves performance by an order of magnitude.
I would expect tests to take similar (small) amount of time regardless of whether there is an await in the beginning or not.
Reproduction
With latest tap and default tap settings, and the following
perf.spec.ts
file:tap finishes in reasonable time:
However, if I comment out
await waitForTick();
, tap takes much much longer:While it's running, most of the time CPU load is high, and the screen looks like this:
Environment
The text was updated successfully, but these errors were encountered: