Skip to content

Benchmarks

Silvia O'Dwyer edited this page Jun 4, 2020 · 5 revisions

You'll find a selection of benchmarks here, comparing Photon's performance to other libraries such as libvips, ImageMagick, and PIL (Python Imaging Library).

The benchmarking tool used for benchmarking other libraries is hyperfine. Photon's benchmarking is conducted by executing cargo bench in the crate. If you'd like to benchmark Photon on your own machine also, just clone this repo, cd into crate and execute cargo bench.

Libvips vs Photon

Inverting a PNG image and saving as a PNG.

Image used: https://i.imgur.com/Uw3DcVe.png

Libvips

Benchmark #1: vips.exe invert input.png output.png

Time (mean ± σ): 915.1 ms ± 36.0 ms [User: 6.2 ms, System: 13.1 ms]

Range (min … max): 887.5 ms … 987.2 ms 10 runs

Photon

Benchmarking invert_image: Warming up for 3.0000 s

invert_image time: **[238.46 ms 244.87 ms 254.62 ms]**

Summary

Photon: [238.46 ms 244.87 ms 254.62 ms]

libvips: 915.1 ms ± 36.0 ms

Inverting a JPG image and saving as a JPG

Photon

Benchmarking invert_image: Warming up for 3.0000 s

invert_image time: [114.67 ms 117.26 ms 122.22 ms]

Found 1 outliers among 10 measurements (10.00%)

1 (10.00%) high mild

Libvips

Benchmark #1: vips.exe invert input.jpg output.jpg

Time (mean ± σ): 84.2 ms ± 12.0 ms [User: 6.3 ms, System: 10.1 ms]

Range (min … max): 66.1 ms … 116.3 ms 18 runs

Summary

Photon: [114.67 ms 117.26 ms 122.22 ms]

libvips: 84.2 ms ± 12.0 ms