Performance libvips vs cjpeg #3867
Replies: 4 comments 1 reply
-
Hi @tados000, I tried here, I see:
libvips takes about 20ms to startup on this laptop:
So it's a little more than a factor of two difference for this test. It would be good to get that down a bit. It's usually best to test whole tasks rather than individual operations. |
Beta Was this translation helpful? Give feedback.
-
Thanks ! I test now vips_resize:
Is it normal that the heavy time is to save the image resiezed and not the command vips_resize ? Is it possible that the image is only resized when the image is save?
Is possible to reduce the time of the resize? Thanks |
Beta Was this translation helpful? Give feedback.
-
Also, in general, |
Beta Was this translation helpful? Give feedback.
-
Speed varies with quite a few factors:
For example:
This PC has 32 hardware threads, so there's a significant cost to pool management, and resizing is so simple there's little speedup.
100ms quicker, and I save 60MB of memory in pixel buffers too. Resize is the same speed in this case:
But for other formats it can help a lot:
For longer pipelines (closer to a real use case) where there's more parallelism, or for operations which parallelise well, leaving the threadpool unrestricted is obviously much better:
As with all benchmarking, it's best to make a test that reflects the actual task you want to measure or optimise. Microbenchmarks will not always be a useful guide to performance in deployment.
|
Beta Was this translation helpful? Give feedback.
-
Hello,
I made a program to convert PNM to JPEG.
I compil with gcc -O3 -o testlibvips testlibvips.c
pkg-config vips --cflags --libs
But it's a little slow :
With cjpeg i have :
test_raw.zip
Beta Was this translation helpful? Give feedback.
All reactions