A rust utility to measure the encoding and decoding performance of various image formats and libraries. Still very much WIP and not ready for general use.
- Download and extract qoi-benchmark suite to corpus/qoi_benchmark_suite.
- Populate corpus/cwebp_qoi_bench by converting those PNGs to WebP images (optional):
cd corpus find qoi_benchmark_suite -name "*.png" | parallel -eta cwebp -exact -lossless {} -o cwebp_qoi_bench/{#}-{%}.webp
Run PNG decoding benchmarks:
cargo +nightly run --release -- decode qoi-bench
Run WebP decoding benchmarks:
cargo +nightly run --release -- decode cwebp-qoi-bench
To drill down into the performance of a particular file, in any format:
cargo +nightly run --release -- decode-single /path/to/file
There are other benchmarks available. For all available options see:
cargo +nightly run --release -- --help
Corpus bench integrates with the innumerable
crate to enable easy gathering of
fine grained statistics about the encoding and decoding process. Any calls to
innumerable::event!
will be aggregated and reported at the end of the run.
The execution times for every single file will also be exported in CSV format.
Generate flamegraph for decoding:
RUSTFLAGS="-C force-frame-pointers=yes" cargo +nightly flamegraph -c "record -F 10000 --call-graph=fp -g" -- decode qoi-bench