Very poor performance on basic tests
See original GitHub issue🐛 Bug Report
I’ve created a simple test with no configuration. You can find it here. It takes 7.6 seconds just to start jest, and then, on file change, it takes 5 seconds to re-run. There’s clearly something wrong here.
Mocha and Chai, for example, start in around 4 seconds, but afterward, the re-run is almost instant.
It’s weird that Jest reports that the test takes 14ms but shows me the result in 5 seconds.
On top of this, if you add more basic tests, the time just seems to go up.
To Reproduce
Clone my minimal repository, yarn install
and yarn test
.
Expected behavior
It should be faster than this.
Link to repl or repo (highly encouraged)
https://github.com/cozmy/jest-performance
Run npx envinfo --preset jest
Paste the results here:
System:
OS: Windows 10
CPU: (8) x64 Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
Binaries:
Node: 8.12.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.13.0 - C:\Users\CosminCristian\AppData\Roaming\npm\yarn.CMD
npm: 6.8.0 - C:\Program Files\nodejs\npm.CMD
Issue Analytics
- State:
- Created 5 years ago
- Reactions:196
- Comments:83 (6 by maintainers)
Top Results From Across the Web
Students performed poorly on an exam - Eberly Center
Students performed poorly on an exam. Exam was not aligned with instructional activities. Exam questions or instructions are ambiguous or confusing. Students ...
Read more >Some students perform poorly on tests for reasons other than ...
Some students perform poorly on tests for reasons other than lack of preparation or poor study skills. This common problem is called test...
Read more >6 Reasons Your Child Does Poorly On Tests | Scholars Canada
Poor organization and time management skills often mean your child isn't studying effectively before a test, leading to poor grades. In many ...
Read more >Simple Strategies for Improving Test Performance
Good reviewing is no substitute for poor studying. Don't expect to start studying one week prior to a test and perform well. The...
Read more >My performance in a test I studied hard for is very poor ... - Quora
Slaving away in front of a computer screen or books for hours on end · Taking notes over and over again · Cramming...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This right here is the issue ☝️
I really, really wish Jest would provide an option not to reload the entire module tree on every single test suite. We write our code in a mostly pure style and do not use mutable global state so it is a complete waste for us to be reloading modules every time. And it is a huge waste: a typical test suite in our code base takes 16 seconds to run, and < 1 second of that is running the actual test!
2 years have gone since I created this issue https://github.com/facebook/jest/issues/7619 I believe the only way to fix this is just to use Mocha/Chai/Jasmine… or anything else but Jest! 😕