Image.concurrency option is confusing
ryanccn opened this issue · comments
The global Image.concurrency
option is set as the concurrency limit for Image
s and not their underlying processes. An Image
can have multiple formats and widths, and all of them are processed with sharp simultaneously, which can be really inefficient, increase resource usage, and reduce performance (not to mention break builds on some platforms!).
IMHO Image.concurrency
should be set as the maximum concurrency of the individual output processes, not the Image
s. I already have a working patch for this that simply uses the global PQueue
for the sharp Promises instead of the Images. Another less optimal solution could be to introduce another option that controls actual processing concurrency.