feat: better cache support via hashobject for example
I've made a reproduction of the issue here https://github.com/thatsmydoing/eslint-import-resolver-typescript-158
On my machine, the v2.7.1 branch takes about 2.30s
% time npm run lint
> [email protected] lint
> eslint main.js
npm run lint 2.26s user 0.23s system 119% cpu 2.085 total
whereas master uses 3.4.0 takes around 27s to run
% npm run lint
> [email protected] lint
> eslint main.js
npm run lint 26.91s user 1.11s system 108% cpu 25.909 total
@thatsmydoing Thanks for reproduction, that would make fixing easier. Or you can help to contribute by yourself!
I made an attempt at https://github.com/import-js/eslint-import-resolver-typescript/pull/166 but I don't think it's possible to get to the previous level of performance with enhanced resolve.
I made an attempt at #166 but I don't think it's possible to get to the previous level of performance with enhanced resolve.
Thanks, that's why I notice to use hashobject in the title of this issue.
@thatsmydoing Can you help to try v3.5.0? And you can help to review https://github.com/import-js/eslint-import-resolver-typescript/pull/174/files#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80R145-R149.
For the sample project and our project, the options object wasn't changing so it was perfectly cached even without hashing it. So there was no additional performance improvement. It's really just enhanced-resolve being much slower at resolving compared to everything else.
@thatsmydoing Thanks for verifying, maybe https://github.com/import-js/eslint-import-resolver-typescript/issues/165 will help.