qr_benchmark

Crates.ioqr_benchmark
lib.rsqr_benchmark
version0.1.0
created_at2025-12-25 02:20:31.642471+00
updated_at2025-12-25 02:20:31.642471+00
descriptionA benchmarking suite for Rust QR code decoding libraries
homepage
repositoryhttps://github.com/cypressf/qr_benchmark
max_upload_size
id2004099
size159,626
Cypress Frankenfeld (cypressf)

documentation

README

QR Code Benchmark

A benchmarking suite for Rust QR code decoding libraries.

Supported Libraries

  • rqrr: Pure Rust port of Quirc.
  • rxing: Rust port of ZXing.
  • bardecoder: Pure Rust QR decoder.
  • zbar: Bindings to the ZBar C library.

Prerequisites

ZBar

To use the zbar feature (enabled by default), you need to have the ZBar C library installed on your system.

macOS:

brew install zbar

Ubuntu/Debian:

sudo apt-get install libzbar-dev

Fedora:

sudo dnf install zbar-devel

Usage

Run the benchmark with default settings:

cargo run --bin qr_benchmark

Options

  • -l, --libs <LIBS>: Specific libraries to benchmark (e.g., -l rqrr -l rxing).
  • -n, --iterations <ITERATIONS>: Number of iterations per image (default: 5).
  • -c, --categories <CATEGORIES>: Specific categories to benchmark (e.g., -c blurred).
  • -o, --output <OUTPUT>: Path to the output CSV file (default: raw_measurements.csv).

Example

cargo run --bin qr_benchmark -- --categories blurred --libs rqrr --iterations 10

Extending

You can use qr_benchmark as a library to benchmark your own decoder. Implement the QrDecoder trait and run the benchmark suite.

See examples/custom_decoder.rs for a complete example.

Analysis

To generate performance visualizations from the benchmark results:

cargo run --bin analyze
Commit count: 0

cargo fmt