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

Tests Speed - Share Thread #155

Open
Twista opened this issue May 21, 2018 · 4 comments
Open

Tests Speed - Share Thread #155

Twista opened this issue May 21, 2018 · 4 comments

Comments

@Twista
Copy link

Twista commented May 21, 2018

Hello Everyone,

First, thanks for great lib, we are using it for a while and it has been big speedup.

Talking about the speed, I found some of our tests are bit slower then we expect (we could get used to too much :D) and therefore I would like to know whats your test results.

Reason is simple, to compare and eventualy see if its worth to dig deeper. There could be some issues within our test cases, or anything not realted. Hope no-one minds to have (at least for while topic like that)

To kick off, there are ours results, code-base has about 20k LOC (about 20-30% is HTML in templates, cuz not all has separate file for), and coverage is little under 70%

Test Suites: 122 passed, 122 total
Tests:       9 skipped, 326 passed, 335 total
Snapshots:   1 passed, 1 total
Time:        188.756s

Tests were executed at CircleCI machine (not so powerfull), but some of tests took more than 10 sec (one took 30s)

Thanks for sharing your results!

@ahnpnl
Copy link
Collaborator

ahnpnl commented Jun 5, 2018

Hi @Twista, do you know what might be the causes which make those tests slow ? From what I observed was the tests which are related to create elements in JSDOM (like creating iframe or bootstrap modal in some of my test suites).
Besides, there is an issue regarding to TestBed memory leak might slow down the tests too.
The CI machine at my work is not so powerful like yours and yes I see the same things like yours.

@ronnyek
Copy link

ronnyek commented Oct 29, 2019

I'm executing 300 tests in as low as 40sec, however I have intermittent runs that occasionally go for as long as 5 minutes.

@bboydflo
Copy link

Here are some of my stats:

Test Suites: 1 skipped, 109 passed, 109 of 110 total
Tests:       3 skipped, 370 passed, 373 total
Snapshots:   244 passed, 244 total
Time:        26.275s, estimated 123s
Ran all test suites.

I was running jest version 24.9.1 before and it was slow. I upgraded to 25.1.0 and first time it still felt slow (total time around 180 seconds). The above stats are for the second time I ran jest, which is much much better.

I am not sure why, but seems that after a fresh npm i my tests are slower the first time but don't take my word for it, try it for yourself!

@thymikee
Copy link
Owner

thymikee commented Feb 26, 2020

I am not sure why, but seems that after a fresh npm i my tests are slower the first time

@bboydflo This is expected, as Jest needs to transpile your source code in-flight. After second run, this code is cached, so it's noticeably faster

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

5 participants