Open alecmev opened 2 years ago
One reason might be that ts-node/esm
uses TSC, which is slowed than Babel (which is used by Jest). However, if you only have 58 tests I'm surprised that it has any visible effect.
Also, the performance of jest-image-snapshot
should not be affected because it runs "outside" Jest. I don't know where the slowdown may come from :thinking:
Will the test use a lot of memory? May be related to GC, I guess single process may be GC worse than multi process.
I was trying out jest-light-runner
hoping for better performance, but it is visibly slower.
In my case it was enough to run a single file with five test cases. A CLI app is being tested, so each test case spawns a process to execute commands with different arguments. Vanilla Jest executes same file in ca. 3.6 and with jest-light-runner
it needs almost 4 seconds.
These are rather long running tests similar to the ones described in the OP. A single test case takes ca. 0.7-0.6 seconds to execute. Perhaps that’s what makes the difference so visible?
I'm doing image snapshot testing, and it's very slow. The exact same file (no
.concurrent
) takes ~21 seconds with this runner, and only ~11 seconds with Jest's built-in. It has 58 snapshots, each invokingsharp
to rasterize an SVG to PNG and passing it tojest-image-snapshot
. Could I be missing something in my setup? I'm usingts-node/esm
on top, just in case (andts-jest
for Jest).