-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fix: use cpuCount for all parallel parts #30548
Conversation
More cores used on minify? I like! |
@@ -12,7 +12,7 @@ sharp.simd(true) | |||
// Handle Sharp's concurrency based on the Gatsby CPU count | |||
// See: http://sharp.pixelplumbing.com/en/stable/api-utility/#concurrency | |||
// See: https://www.gatsbyjs.org/docs/multi-core-builds/ | |||
sharp.concurrency(cpuCoreCount()) | |||
sharp.concurrency(cpuCoreCount() - 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.
Does concurrency make sense for the manifest plugin at all? It is for a single icon resizing, right?
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.
yeah — it wouldn't ever use more than one core
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.
Problem here is that sharp is a singleton so it will be shared with gatsby-plugin-sharp :'(
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.
But gatsby-plugin-sharp
now has concurrency 1 (after this PR: #28575):
gatsby/packages/gatsby-plugin-sharp/src/process-file.js
Lines 19 to 20 in f628c38
// Concurrency is handled in gatsby-worker queue instead | |
sharp.concurrency(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.
I wonder what is the actual behavior currently if you have both plugins 🤔
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 interesting :D I'll set it to one than. Basically last one in gatsby-config wins
|
465404a
to
3847e1e
Compare
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.
👍
Description
Not every part of Gatsby is using
cpuCoreCount
and we should always do -1 to make sure the main process is left alone.