oxipng icon indicating copy to clipboard operation
oxipng copied to clipboard

--fast seems to only use one thread for most of the processing

Open C0rn3j opened this issue 1 year ago • 3 comments

image

oxipng --fast --opt max even with --threads 10 uses one thread for the processing except for the small part at the very beginning, is this expected?

oxipng 9.0.0 on Arch Linux

C0rn3j avatar Apr 17 '24 15:04 C0rn3j

Hi @C0rn3j, yes this is expected behaviour. See the description in the help:

Perform a fast compression evaluation of each enabled filter, followed by a single main
compression trial of the best result. Recommended if you have more filters enabled than
CPU cores.

It's also helpful if you're processing many files at once, but if you're just doing one file at a time and have plenty of CPU cores then you're probably best to leave it off.

andrews05 avatar Apr 17 '24 20:04 andrews05

I got the impression that this would run small trials first and then just run whatever method worked the best on the small scale, with all cores.

So while it might have not been the best end result, it would be a reasonably fast result (x5 CPU time instead of x100 for just pure --zopfli).

Is there anything preventing from this running the final trial at max CPU?
I would prefer not having to parallelize this myself.

C0rn3j avatar Apr 22 '24 10:04 C0rn3j

Neither libdeflate nor zopfli currently support parallelisation, so it's not possible to get any more speed out of it unfortunately.

andrews05 avatar Apr 22 '24 21:04 andrews05