-
-
Notifications
You must be signed in to change notification settings - Fork 49
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
perf: use finishModules
#73
Conversation
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 8 8
Lines 243 250 +7
Branches 65 70 +5
=========================================
+ Hits 243 250 +7
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add test, should be not hard, because we can spy eslint
/cc @alexander-akait |
I think that using "outside set" and checking if file is in this set is kind of performance issue, as finishModules hook is called only once we can came with better solution: const resources = Array.from(modules)
// @ts-ignore
.filter((module) => module.resource)
// @ts-ignore
.map(({ resource }) => resource.split('?')[0])
.filter((resource) => resource /* && !seen.has(resource) */ && isMatch(resource, wanted) && !isMatch(resource, exclude));
const resourcesUnique = new Set(resources);
//... |
By moving the finishModule hook we no longer spread the linting work out... one lump (in my case 5620 files) gets sent to the linter in one go. The thread pool (if threaded) does not fill up... only one worker gets all the jobs. |
This PR contains a:
Motivation / Use-Case
Use the hook
finishModules
to lint more files and not one by oneResolve #70
Breaking Changes
Additional Info