11ty / eleventy-img

Utility to perform build-time image transformations.

Home Page:https://www.11ty.dev/docs/plugins/image/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Image.concurrency option is confusing

ryanccn opened this issue · comments

The global Image.concurrency option is set as the concurrency limit for Images 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 Images. 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.