Unlocking Efficiency: A Multi-Language Benchmarking Study on MNIST
Vaibhav Satishkumar, Yucheng Lu · 2025
This study investigates the efficiency of various programming languages (Rust, Python, C++) by executing a standardized MNIST image classification benchmark. Our methodology focuses on performance metrics including total execution time, memory consumption, and GPU energy usage to quantify the trade-offs associated with language choice. The results demonstrate that compiled languages (C++ and Rust) are significantly faster and more energy-efficient than Python, with C++ being marginally the fastest. Counterintuitively, the C++ implementation recorded the highest memory usage, while Python proved to be the most memory-frugal. We conclude that a critical trade-off exists between execution speed and memory overhead, providing quantitative data to guide developers in selecting optimal languages for sustainable and high-performance machine learning systems.