new cache for readFile, fileExists, directoryExist, is not working as advertised #29107
Labels
Domain: Performance
Reports of unusually slow behavior
Needs Investigation
This issue needs a team member to investigate its status.
Working as Intended
The behavior described is the intended behavior; this is not a bug
I encountered a significant performance drop in ts-jest which I was able to track down to typescript reading package.json files over and over.
After doing so I realized that you knew of this problem and that you even already pushed a fix for it
So I updated typescript and it got even worse. The node_modules folder of the demo repository contains 600 package.json files which result in about 35k readFile calls to these files.
TypeScript Version: 3.3.0-dev.20181220
Search Terms: cache readFile fileExists directoryExist readJson
Code https://gitlab.com/Farbdose/ts-jest-multiple-fileread/tree/typescript-3.3.0
This almost empty repository takes now 45 seconds in the gitlab build pipeline to run an empty jest test-suite.
Be aware that there is a non-zero chance that this is caused by some bad interaction between typescript, jest, ts-jest and ionic but I'm out of ideas...
Expected behavior: read each package.json only once
Actual behavior: each file in the node_modules folder causes at least one readFile-call to the package.json of the module it's located in
Related Issues:
#27068 #28629
kulshekhar/ts-jest#908
ionic-team/ionic-framework#16703
The text was updated successfully, but these errors were encountered: