-
-
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
Threads #39
Threads #39
Conversation
Codecov Report
@@ Coverage Diff @@
## master #39 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 8 +1
Lines 175 200 +25
Branches 48 55 +7
=========================================
+ Hits 175 200 +25
Continue to review full report at Codecov.
|
This cuts my build time nearly in half. ~169s down to ~85s. :) |
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.
Why do not use jest-worker
? All these problems have already been solved, also simple and good API
Also I think it should be implemented on eslint side, but it is trade-off
I was trying to not add dependencies. This uses just the API provided by node 12+. I also was not aware of jest-worker. I will look at it.
We are passing one file at a time to |
Using
Yep, agree |
swapped to using jest-worker. |
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.
/cc @ricardogobbosouza, looks good for me
@@ -1,5 +1,6 @@ | |||
{ | |||
"compilerOptions": { | |||
"noEmit": true, |
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.
/cc @ricardogobbosouza I think here mistake
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.
no, that was intentional. tsc was attempting to overwrite source files without that and producing an error in vscode. There is an inverse of that on the npm script generating the type definitions.
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.
oh, yes, my mistake
const max = | ||
typeof threads !== 'number' | ||
? threads | ||
? os.cpus().length - 1 |
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.
What is the reasoning to use less threads than cpus?
In the old make days one would usually have done n+1 as someone might always be io blocked.
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.
One CPU for webpack, otherwise you can block webpack thread
This PR contains a:
Motivation / Use-Case
Push eslint onto a thread pool. For large projects, this helps speed it up.
Additional Info
This is using a feature introduced in node 12... so it will fallback and disable the thread pool if it's not available.