-
Notifications
You must be signed in to change notification settings - Fork 454
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
Massive performance degradation in getCacheKey() #2696
Comments
in v27, we did a fix for watch mode as well as normal mode to fix issues with type checking not perform correctly. The solution requires to add processing file's related files into cache key to inform Jest later that if any related files change, Jest needs to reprocess. For example:
v26 doesn't have this solution which explained your observation. The solution was came up because |
If I right understand the problem all my test runs start to use most of available memory and in some cases like CI (bitbucket pipelines) where you have memory limits it starts fail. On jest 26 packages everything is ok. |
Experiencing the same issue. We have 300+ Angular tests and I can't even run them locally after migration. |
In our case, we are suffering from this "design choice" and just put "--no-cache" to command that runs tests and see 2-3x performance "boost" due to ts-jest have no cache and have no performance degradation One angular project that tests by 6m now runs by 2m40s |
In our case, having a cold jest-cache takes 4 times longer than running jest with --no-cache. But in our multi-project nx-workspace, using the nx-cli, the jest-cache cannot be properly deactivated, so we would have to run jest directly and therefore would also lose the advantage of the nx-cache. So for us, enabling the "isolatedModules" options seems to be the only usable workaround, which is even 26% faster than running with --no-cache |
Wouldn't it be a solution for CI environments to restore the old |
I logged #2707 and closely-related #1747. In the first, I added a comment that I had eventually implemented a workaround for that bug. Maybe this design change should be rolled back for the sake of performance in the short term. It's a choice of which bug is worse. |
🐛 Bug Report
The
getCacheKey()
function seems to degradate as the amount of files increases. I observed this in a project with a few thousands of files when upgrading from Jest 26 to 27.To Reproduce
A few hundreds of files which have to be transformed.
Expected behavior
Performance remains constant.
Link to repo (highly encouraged)
Unfortunately I can't share the repo. But I added some logging to that function.
jest@27.0.5 ts-jest@27.0.3
With Jest 26 everything is fine:
jest@26.6.3 ts-jest@26.5.6
envinfo
The text was updated successfully, but these errors were encountered: