Install system libraries:
- libvips-dev (used in benchmarks)
Install additional toolchains:
- Arm64:
rustup target add aarch64-unknown-linux-gnu
- Wasm32:
Install Wasmtime.
rustup target add wasm32-wasip2
Run tests with saving result images as files in ./data directory:
SAVE_RESULT=1 cargo testRun benchmarks to compare with other crates for image resizing and write results into
report files, such as ./benchmarks-x86_64.md:
WRITE_COMPARE_RESULT=1 cargo bench -- CompareIf you want to use old benchmark results for other crates, you must add an env variable with the number of days as a result lifetime:
WRITE_COMPARE_RESULT=1 RESULTS_LIFETIME=5 cargo bench -- CompareRun a specific benchmark in quick mode:
cargo bench --bench bench_resize -- --color=always --quickSpecify build target and runner in .cargo/config.toml file.
[build]
target = "wasm32-wasip2"
[target.wasm32-wasip2]
runner = "wasmtime --dir=. --"Run tests:
cargo testRun tests with saving result images as files in ./data directory:
CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime --dir=. --env SAVE_RESULT=1 --" cargo testRun benchmarks to compare with other crates for image resizing and write results into
report files, such as ./benchmarks-wasm32.md:
CARGO_TARGET_WASM32_WASIP2_RUNNER="wasmtime --dir=. --env WRITE_COMPARE_RESULT=1 --" cargo bench --no-fail-fast -- --color=always Compare