kornelski / cavif-rs

AVIF image creator in pure Rust
https://lib.rs/cavif
BSD 3-Clause "New" or "Revised" License
570 stars 27 forks source link

Add option to use global rayon thread pool #56

Closed Szpadel closed 2 years ago

Szpadel commented 2 years ago

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.

kornelski commented 2 years ago

Thanks for the PR.