Docs: expand info about parallelism and concurrency control #4411

This commit is contained in:
Lovell Fuller
2025-06-16 12:02:09 +01:00
parent c4b1d80c35
commit e688c53659
3 changed files with 46 additions and 26 deletions

View File

@@ -135,15 +135,9 @@ cache(true);
* e.g. libaom manages its own 4 threads when encoding AVIF images,
* and these are independent of the value set here.
*
* The maximum number of images that sharp can process in parallel
* is controlled by libuv's `UV_THREADPOOL_SIZE` environment variable,
* which defaults to 4.
*
* https://nodejs.org/api/cli.html#uv_threadpool_sizesize
*
* For example, by default, a machine with 8 CPU cores will process
* 4 images in parallel and use up to 8 threads per image,
* so there will be up to 32 concurrent threads.
* :::note
* Further {@link /performance|control over performance} is available.
* :::
*
* @example
* const threads = sharp.concurrency(); // 4