Investigate speed regressions
See original GitHub issueš„ Regression Report
Speed regression in Jest@23.x
Last working version
Worked up to version:
Jest@22.x
Stopped working in version:
A big chunk of the regression was introduced with this PR https://github.com/facebook/jest/pull/5932
To Reproduce
Steps to reproduce the behavior:
Iāve been using a small repo, https://github.com/rogeliog/jest-benchmark(I can give you access if you need to) to run simple benchmarks across Jest versions.
Expected behavior
Test should run faster
Here are is progress that Iāve made on the speed regression investigation.
- A big chunk of the speed regression was introduced here https://github.com/facebook/jest/pull/5932
- Iāve been testing with https://github.com/rogeliog/jest-benchmark and the differences that I get between jest@22 and jest@23 are the following
------------------- Jest@22 ------------------------- 0m2.338s 0m2.317s ------------------- Jest@23 ------------------------- 0m6.068s 0m6.048s
Initial findings
-
In jest@22 https://github.com/facebook/jest/blob/v22.4.4/packages/jest-config/src/normalize.js#L128 returns
null
which causes https://github.com/facebook/jest/blob/v22.4.4/packages/jest-config/src/normalize.js#L130-L132 not to get executed. -
In jest@23 https://github.com/facebook/jest/blob/master/packages/jest-config/src/normalize.js#L143 returns a path and https://github.com/facebook/jest/blob/master/packages/jest-config/src/normalize.js#L144-L146 gets executed.
-
If I comment out https://github.com/facebook/jest/blob/master/packages/jest-config/src/normalize.js#L144-L146 then I get the following stats.
------------------- Jest@22 ------------------------- 0m2.537s 0m2.331s ------------------- Jest@dev ------------------------- 0m3.658s 0m3.633s
-
Iām not to familiar the reasoning behind it, but it seems that since the original there were some comments about them returning different values https://github.com/facebook/jest/pull/5932#discussion_r179545920.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:11 (4 by maintainers)
Top GitHub Comments
For what itās worth, turns out I misdiagnosed the cause of the problem. It was actually an upgrade from ts-jest
23.1.4
->23.10.5
which was causing the large slowdown and memory usage increase (babel and jest proper were red herrings). We found switching our jest config from:to
resolved the performance issues for us! Just posting the info here to absolve jest of the blame I put on it š and to help anyone else if they have similar issues with ts-jest
please check my comment here: problem: https://github.com/facebook/jest/issues/6783#issuecomment-445560998 investigation: https://github.com/facebook/jest/issues/6783#issuecomment-445660665 cause: https://github.com/facebook/jest/issues/6783#issuecomment-446123323 solution: https://github.com/facebook/jest/pull/7518
I am sure 100% that the TestScheduler is creating the regression for the case i reported in the issue. I donāt know yet if solving this will help with the run on all files => if you think i should isolate this in a specific issue let me know.