Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Overview
I'm investigating performance traces of typescript-eslint work in preparation for v8 (#9571). You can find some preliminary traces inhttps://github.com/typescript-eslint/performance/blob/c5e8a725ad5338a3dca5cebcd69f5a802df8c8d6/README.md#tracing-measurements ->https://github.com/typescript-eslint/performance/blob/main/traces/Project%201%20-%20Service%202.cpuprofile.
If you look at the call stack in an example project with a large number of simple files, quite a few of them are spending anywhere from ~0.3ms to ~2ms inpopulateGlobalsFromLib
, sometimes including garbage collection:
Most rules don't actually use the scope manager, and sometimes only conditionally. So this function is unnecessary for many projects!
I tried commenting it out and lint times for ~1024.ts
files, even layout,parserOptions.project
went from ~3.8s to ~2.8s. That's a great savings!
Even in projects where it is necessary, it seems exceptionally long to spend over a ms on it. I wonder if switching the data structures around to a more performant loop style (e.g. from an object to an array) would be helpful.
BothparserOptions.project
andparserOptions.projectService
are showing this behavior.