criteo / JVips

Java wrapper for libvips using JNI.
Apache License 2.0
72 stars 41 forks source link

Question about Blog Post benchmarks #85

Open rajasagashe opened 3 years ago

rajasagashe commented 3 years ago

Hello, thanks for writing this excellent blog post https://medium.com/criteo-labs/boosting-image-processing-performance-from-imagemagick-to-libvips-268cc3451d55.

The blog post mentions that JVips gives significant improvement over image magick: "up to x8 on JPEGs and x2.3 on PNGs with 8 threads". However, the graph is a bit vague and doesn't specify what's being measured.

Is this improvement in processing time for a single image where libvips is able to use the 8 threads to process it faster? Or does it refer to throughput where each thread is processing an image on its own as shown inExecutorServiceExample?

dbouron commented 3 years ago

Hello,

Thanks for reading.

The "x8 on JPEGs and x2.3 on PNGs with 8 threads" refers to a simple benchmark which compares JMagick and JVips. It reads a 1920x1080 image, resize it (ImageScale for JMagick and thumbnail for JVips) and write the output in a buffer.

The graph measured the image processing time spent in the processing pool. It includes at least one operation (resizing) and some others operations may be applied (padding, cropping). Thus, the improvement that you can observe in the graph is in production with a high image traffic.

The ExecutorServiceExample is an example to show how avoid crash when using an executor (see.also.: https://github.com/criteo/JVips/issues/42)