Table of Contents
Fetching ...

Need for Speed: A Comprehensive Benchmark of JPEG Decoders in Python

Vladimir Iglovikov

TL;DR

This work benchmarks nine Python JPEG decoders across ARM64 and x86_64 platforms to quantify end-to-end loading performance, including disk I/O. By comparing libjpeg-turbo-based implementations (e.g., jpeg4py, kornia-rs) against standard libjpeg and feature-rich libraries, the study finds TurboJPEG-based paths offer up to $1.5\times$ higher throughput. Rust-based and direct-binding approaches demonstrate strong, low-overhead performance, with OpenCV providing robust balance between speed and image-processing capabilities. Platform-specific optimizations (notably SIMD) yield differing gains, but the overall message is that decoder choice and binding strategy dominate, guiding practitioners in selecting for high-throughput training or real-time workflows. The results inform cross-platform development and ecosystem decisions, helping reduce training times and improve system efficiency.

Abstract

Image loading represents a critical bottleneck in modern machine learning pipelines, particularly in computer vision tasks where JPEG remains the dominant format. This study presents a systematic performance analysis of nine popular Python JPEG decoding libraries on different computing architectures. We benchmark traditional image processing libraries (Pillow, OpenCV), machine learning frameworks (TensorFlow, PyTorch), and specialized decoders (jpeg4py, kornia-rs) on both ARM64 (Apple M4 Max) and x86\_64 (AMD Threadripper) platforms. Our findings reveal that modern implementations using libjpeg-turbo achieve up to 1.5x faster decoding speeds compared to traditional approaches. We provide evidence-based recommendations for choosing optimal JPEG decoders across different scenarios, from high-throughput training pipelines to real-time applications. This comprehensive analysis helps practitioners make informed decisions about image loading infrastructure, potentially reducing training times and improving system efficiency.

Need for Speed: A Comprehensive Benchmark of JPEG Decoders in Python

TL;DR

This work benchmarks nine Python JPEG decoders across ARM64 and x86_64 platforms to quantify end-to-end loading performance, including disk I/O. By comparing libjpeg-turbo-based implementations (e.g., jpeg4py, kornia-rs) against standard libjpeg and feature-rich libraries, the study finds TurboJPEG-based paths offer up to higher throughput. Rust-based and direct-binding approaches demonstrate strong, low-overhead performance, with OpenCV providing robust balance between speed and image-processing capabilities. Platform-specific optimizations (notably SIMD) yield differing gains, but the overall message is that decoder choice and binding strategy dominate, guiding practitioners in selecting for high-throughput training or real-time workflows. The results inform cross-platform development and ecosystem decisions, helping reduce training times and improve system efficiency.

Abstract

Image loading represents a critical bottleneck in modern machine learning pipelines, particularly in computer vision tasks where JPEG remains the dominant format. This study presents a systematic performance analysis of nine popular Python JPEG decoding libraries on different computing architectures. We benchmark traditional image processing libraries (Pillow, OpenCV), machine learning frameworks (TensorFlow, PyTorch), and specialized decoders (jpeg4py, kornia-rs) on both ARM64 (Apple M4 Max) and x86\_64 (AMD Threadripper) platforms. Our findings reveal that modern implementations using libjpeg-turbo achieve up to 1.5x faster decoding speeds compared to traditional approaches. We provide evidence-based recommendations for choosing optimal JPEG decoders across different scenarios, from high-throughput training pipelines to real-time applications. This comprehensive analysis helps practitioners make informed decisions about image loading infrastructure, potentially reducing training times and improving system efficiency.
Paper Structure (39 sections, 2 figures)