-
Notifications
You must be signed in to change notification settings - Fork 455
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
fix(perf): add cache for fs calls when using language service (#908) #940
Conversation
Pull Request Test Coverage Report for Build 2443
💛 - Coveralls |
@kulshekhar, would you please provide your feedback? Thanks |
@IOuser I wanted to test your fix with my demo repository but for some reason I can't get ts-jest to build. It always fails with Can't I build ts-jest with:
? Do I need to do something specific after cloning the repository (except |
@Farbdose, I ran into a similar problem, npm just updates all dependencies as they are not fixed in |
@IOuser many thanks. That looks much cleaner than my own fix:
|
@Farbdose, did you checkout to |
@IOuser Just realized that too, I was only searching for the word memoize and it was in dist do I didn't look further Regarding the submodule checkout ... I ... did ... and I may have accidentially added a Now we are getting somewhere: I have a clear speedup from 45s to 36s in the gitlab CI and 33s on my local SSD. Branch: add-simple-cache-for-fs-calls Thats more or less what I got too with my early hacks in the compiler.js but thats still way to long for an empty test suite. Even if I have some heavy modules. |
@IOuser new cpu-profile and ts-jest log I think we are still lossing some time on parsing the contents of the cached package.json files over and over. |
@Farbdose, now I see. In |
I'd love to merge this in. We already have lodash.memoize as a dependency, can we use that instead of implementing our own function? |
Hi there, thanks for your great work maintaining this repo. I just want to know what the state of this PR is. |
addressed in #1049 |
Recently, I encountered the slowdown of tests with disabled jest cache.
As @Farbdose noted in #908 , the reason for the slowdown is intensive work with the file system.
So I tried to implement a simple cache for fs calls in TS language service.
And here's results for my codebase:
Before adding fs cache: ~280s (3 runs avg.)
After adding fs cache: ~91s (3 runs avg.)
Hope it helps.