[Paper Review] Need for Speed: A Comprehensive Benchmark of JPEG Decoders in Python
The paper benchmarks nine Python JPEG decoders across ARM64 and x86_64, showing libjpeg-turbo-based implementations offer up to 1.5x faster decoding, and provides practical recommendations.
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.
Motivation & Objective
- Assess end-to-end JPEG decoding performance for popular Python libraries across two architectures.
- Identify how underlying decoders (libjpeg vs libjpeg-turbo) influence speed and where abstractions add overhead.
- Provide practical recommendations for high-throughput, real-time, and development use cases.
Proposed method
- Benchmark nine Python JPEG decoders across two platforms (ARM64 and x86_64).
- Use 2000 ImageNet validation images with varied resolutions (90x90 to 3264x2792).
- Measure total time for loading and decoding, with 20 runs per library and cold-start cache clearing.
- Include disk I/O in the timing to reflect real-world usage.
- Compare implementations: Pillow, OpenCV, scikit-image, imageio, TensorFlow, torchvision, kornia-rs, jpeg4py, and others.
- Analyze impact of libjpeg vs libjpeg-turbo and implementation language on performance.

Experimental results
Research questions
- RQ1Which Python JPEG decoders offer the best end-to-end decoding performance on ARM64 and x86_64?
- RQ2How does the underlying JPEG decoder (libjpeg vs libjpeg-turbo) affect speed across libraries?
- RQ3What is the impact of implementation language and abstraction layers on decoding performance?
- RQ4How do platform differences influence performance of JPEG decoding libraries?
- RQ5What practical recommendations emerge for high-throughput pipelines vs. development use?
Key findings
- TurboJPEG-based implementations generally outperform standard libjpeg-based ones across platforms. (e.g., top-tier performers include kornia-rs, OpenCV, torchvision on ARM64).
- On ARM64 (Apple M4 Max), top performers are: kornia-rs 1034 img/sec, OpenCV 1016 img/sec, torchvision 992 img/sec; mid-tier include imageio 777 img/sec, Pillow 775 img/sec, scikit-image 766 img/sec; TensorFlow 664 img/sec.
- On x86_64 (Threadripper), top performers include jpeg4py and kornia-rs with strong OpenCV presence; mid-tier include torchvision and Pillow-SIMD; lower-tier include scikit-image and standard Pillow.
- Libraries using libjpeg-turbo (jpeg4py, kornia-rs, OpenCV, torchvision) show higher performance than those using standard libjpeg (Pillow, imageio, scikit-image).
- Modern implementations (notably Rust-based kornia-rs) benefit from reduced overhead and SIMD optimizations, achieving high performance across platforms.
- Pillow remains stable and compatible but generally slower than TurboJPEG-based options; OpenCV offers strong performance within computer-vision workflows.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.