AVIF conversion in Rust for an e-commerce platform, looking for fast, pure Rust solutions
Hey Rust devs,
I'm building a Rust e-commerce platform (Axum + SQLx + Redis, fully async via Tokio) that handles products, orders, carts, authentication, and image processing. The platform is mostly finished, so I'm polishing the last parts. (I will share my code on a public git for anyone interested in about a week). The platform has everything default WooCommerce offers and more, plus it is very easy to add extra features at this point.
The problem: AVIF conversion with ravif is very slow, especially for larger product images. I also tried using libvips bindings, but I couldn't get it to work consistently, it was crashing every now and then. I want a fast, pure Rust solution.
I'm using ravif with quality 63 and speed 4. The parallel approach helps significantly since all sizes and formats run simultaneously, but AVIF encoding is still painfully slow compared to WebP (near-instant) and JPG (instant).
Questions:
- Are there any faster Rust-native AVIF crates or techniques?
- Any tips for optimizing AVIF conversion in Rust while keeping memory safety and performance?
- How to measure CPU and RAM usage reliably during those conversions so I don't face issues on my server?
Current stack: image crate for loading/resizing, ravif for AVIF, webp crate for WebP, Tokio for async/parallelization. Open to suggestions for improvements or completely different approaches!
Posted Oct 28, 2025, 4:55 PM UTC