-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Jest 24 is 67% slower than Jest 23.6.0 on the same test suite #7732
Comments
We need some sort of reproduction here. I haven't seen any difference between 23 and 24 when upgrading, so it might be certain patterns that hsve regressed |
For me the Jest keeps writing new jest-transform-cache folder on every jest run.
|
Interesting! That would definitely slow things down. Does that happen in many projects? Could you post your config? |
Here are babel.config.js, jest.config.js, package.json, yarn.lock |
To me 24 seems slower when there is a cache available, but about the same as 23 when there is no cache, so it seems like @CrOrc is on to something. Here are my results (ran the tests three times with each config): 23.6.0 - Runs after clearing the cache with Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total 23.6.0 - Runs without clearing the cache: Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total 24.0.0 - Runs after clearing the cache with Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total 24.0.0 - Runs without clearing the cache: Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total Test Suites: 36 passed, 36 total |
Just to say that I'm seeing the same as @CrOrc. Every run of jest with 24.0.0 produces a new |
Cannot provide repro due to working on proprietary code, but I can confirm this from our CI logs. Tests phase takes up to 5 minutes longer after moving from Jest 23.6 -> 24.0, with no other code changes being made. I tried adding the Jest 24.0 : 10-15 MB/s total for 4 Jest workers I know the above is anecdotal for our machines, but as suggested by @CrOrc it seems that Jest 24.0 makes significantly more cache writes than 23.6. |
I can confirm caching of transformed files are broken. It's due to this line (from #5862): https://github.com/facebook/jest/blob/31b81ba37eb779161b6db78aa862c0bcd6465bd5/packages/jest-config/src/normalize.js#L272 Removing it speeds up rerunning the same tests by 300% for me in watch mode. When we get to the cache key, the entire config serialized as a string is part of the cache name, and that will change for every single invocation of Jest: |
workaround is to set |
PR: #7746 |
Sorry, where do we set the name? I only have a single config and it is declared in |
Also wondering where to set the Setting it in my |
Setting
Both of those times are from a warm start (I ran Jest twice before recording the time). Unfortunately I can't share the code. It's running around 300 test suites, around 3000 tests, and around 300 snapshots. Edit: I also have |
Any chance of getting a 24.0.1 patch release to fix this? :-) As it stands we are unable to use 24.0.0 due to the significant perf drop ... Thanks!
…
On Feb 4, 2019 at 3:01 PM, <Dylan Vann ***@***.***)> wrote:
Setting name in my jest.config.js file does significantly speed up runs after the first one, but even after that I've found Jest 24 is about 50% slower than Jest 23.
Jest 23: 70s Jest 24: 105s
Both of those times are from a warm start (I ran Jest twice before recording the time).
Unfortunately I can't share the code. It's running around 300 test suites, around 3000 tests, and around 300 snapshots.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#7732 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AmWxt93AFetN_h5zaBoK1rQjV0g0VLAHks5vKLu4gaJpZM4aVLHW).
|
24.1.0 is released |
Can people test that, and if they still have perf regressions compared to 23, open up a new issue? |
Will do and thanks!
…
On Feb 5, 2019 at 7:19 AM, <Simen Bekkhus ***@***.***)> wrote:
Can people test that, and if they still have perf regressions compared to 23, open up a new issue?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#7732 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AmWxtwS4-_2TkU66cQtzJyLwNO6yM_miks5vKaD8gaJpZM4aVLHW).
|
using jest 24.3.1 vs jest 23.6.0 jest 24.3.1: 108s |
Let me share my profiling here.
Steps:
CPU Profile: Is it expected that 15 seconds are spent only with requring modules for single trivial React component and test? Can someone with more experience on CPU profiling take a look? |
@mucsi96 a big part of that is likely micromatch, which is already known as a performance problem and will be fixed in 25 |
Which Jest package depends on |
Thanks! I have tried to replace micromatch 3 with latest 4.0.2 in Specs:
Steps:
CPU Profile: |
@mucsi96 The issue with TS being slow may be caused by the order of module extension resolution. By default, Jest searches first for However, looking at the source, CRA has its own list, which is not allowed to be overridden: https://github.com/facebook/create-react-app/blob/b96ac6c2c007db85812a6e9c0ec54509019c0fea/packages/react-scripts/config/paths.js#L49-L61. You could try passing it as a flag to the CLI, but not sure about that. I'd try adjusting the list in node_modules, making sure it works faster and then send a PR to CRA with adjusted |
Thanks for noting this. I have already submitted an different issue due to |
I have tried |
Also this issue seems to be not related to TypeScript. With |
My project was using the old one |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🐛 Bug Report
Thanks for your hard work releasing jest 24!
A clear and concise description of what the bug is.
On jest 23.6.0 my test collection that totals 49 test suites and 700 tests took on average 11.9 seconds to run. Now in jest 24.0.0 it takes 19.9 seconds to run, with no changes of any kind to my code, tests or environment other than upgrading to jest 24. I'm not doing anything fancy.
This is a serious performance regression. I want to use jest 24 to take advantage of
test.todo
but I can't afford to have my tests take 67% longer to run - that's a real drop in my productivity.Any suggestions how to diagnose this further or fix this issue? I can't post source code because this is proprietary code I'm working on. How can we fix this performance regression?
To Reproduce
Steps to reproduce the behavior:
Run a set of tests in jest 23.6.0.
Run that same set of tests in jest 24.0.0.
Expected behavior
A clear and concise description of what you expected to happen.
Jest 24.0.0 should NOT be 67% slower than jest 23.6.0 for the same set of tests.
Link to repl or repo (highly encouraged)
Please provide either a repl.it demo or a minimal repository on GitHub.
Issues without a reproduction link are likely to stall.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: