Replies: 1 comment 4 replies
-
It does not use workers, but image generation is already done concurrently, it processes a few images at once. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Body
Summary
Using
<Image />
,<Picture />
orgetImage()
will cause all images to be optimized sequentially. This is slow when you have a lot of somewhat big source images. I'd like a new option to run this process to run in parallel, i.e. on multiple CPU cores.Background & Motivation
I've only tried this with
getImage()
and made a trivial attempt to trick astro into parallelizing it which sadly didn't work:Ideally, I shouldn't even have to manually handle the parallelization logic. Since astro knows what images to optimize anyway, it could handle the "scheduling" of tasks itself, even when my frontmatter/server code is blocking/sequential.
Goals
Example
I really don't care about what this would look like. I could imagine something like:
An auto-detection option to set workers=number of host CPU cores would also be a nice addition
Beta Was this translation helpful? Give feedback.
All reactions