When you have multiple optimizations (including other encoders using rayon, like webp or png) using dedicated thread pool causes some locks that cause some locks inside rayon to block all threads except one, this causes that only one cpu core is utilized for whole application.
Because I do not see any way to disable rayon here, other option is to use global thread pool - this scenario seams to also not cause any issues.
When you have multiple optimizations (including other encoders using rayon, like webp or png) using dedicated thread pool causes some locks that cause some locks inside rayon to block all threads except one, this causes that only one cpu core is utilized for whole application.
Because I do not see any way to disable rayon here, other option is to use global thread pool - this scenario seams to also not cause any issues.