Docs: libvips manages its own thread pool (#4455)

This commit is contained in:
Kleis Auke Wolthuizen 2025-09-20 14:03:38 +02:00 committed by GitHub
parent 3498eb63e3
commit c446d743a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,8 +17,8 @@ before the Node.js process starts to increase the thread pool size.
export UV_THREADPOOL_SIZE="$(lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l)" export UV_THREADPOOL_SIZE="$(lscpu -p | egrep -v "^#" | sort -u -t, -k 2,4 | wc -l)"
``` ```
libvips uses a glib-managed thread pool to avoid the overhead of spawning new threads. libvips uses a shared thread pool to avoid the overhead of spawning new threads.
The size of the shared thread pool will grow on demand and shrink when idle. The size of this thread pool will grow on demand and shrink when idle.
The default number of threads used to concurrently process each image is the same as the number of CPU cores, The default number of threads used to concurrently process each image is the same as the number of CPU cores,
except when using glibc-based Linux without jemalloc, where the default is `1` to help reduce memory fragmentation. except when using glibc-based Linux without jemalloc, where the default is `1` to help reduce memory fragmentation.