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

Slower than Jest #52

Open
alecmev opened this issue Aug 3, 2022 · 3 comments
Open

Slower than Jest #52

alecmev opened this issue Aug 3, 2022 · 3 comments

Comments

@alecmev
Copy link
Contributor

alecmev commented Aug 3, 2022

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 invoking sharp to rasterize an SVG to PNG and passing it to jest-image-snapshot. Could I be missing something in my setup? I'm using ts-node/esm on top, just in case (and ts-jest for Jest).

@nicolo-ribaudo
Copy link
Owner

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 🤔

@liuxingbaoyu
Copy link
Contributor

Will the test use a lot of memory? May be related to GC, I guess single process may be GC worse than multi process.

@mrazauskas
Copy link

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?

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

No branches or pull requests

4 participants