Skip to content
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

feat: better cache support via hashobject for example #158

Closed
JounQin opened this issue Jul 24, 2022 · 7 comments · Fixed by #174
Closed

feat: better cache support via hashobject for example #158

JounQin opened this issue Jul 24, 2022 · 7 comments · Fixed by #174

Comments

@JounQin
Copy link
Collaborator

JounQin commented Jul 24, 2022

No description provided.

@thatsmydoing
Copy link
Contributor

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

> eslint-import-stress-test@1.0.0 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

> eslint-import-stress-test@1.0.0 lint
> eslint main.js

npm run lint  26.91s user 1.11s system 108% cpu 25.909 total

@JounQin
Copy link
Collaborator Author

JounQin commented Aug 12, 2022

@thatsmydoing Thanks for reproduction, that would make fixing easier. Or you can help to contribute by yourself!

@thatsmydoing
Copy link
Contributor

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.

@JounQin
Copy link
Collaborator Author

JounQin commented Aug 12, 2022

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.

@JounQin
Copy link
Collaborator Author

JounQin commented Aug 22, 2022

@thatsmydoing
Copy link
Contributor

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.

@JounQin
Copy link
Collaborator Author

JounQin commented Aug 23, 2022

@thatsmydoing Thanks for verifying, maybe #165 will help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants