Document Type : Original Article
Authors
University of Guilan
Abstract
Rust has gained increasing attention in performance-critical software development due to its memory safety, zero-cost abstractions, and native execution performance. This study presents a comparative performance evaluation of Rust, C, C++, Java, Python, and JavaScript using matrix multiplication as a representative compute-intensive workload. The languages are evaluated under sequential, parallel, and optimized numerical library configurations. Sequential and parallel implementations use 500×500 matrices and language-appropriate parallelization mechanisms, while library-based experiments use 1000×1000 matrices with OpenBLAS, NumPy, and faer for C, Python, and Rust, respectively. Execution time and peak memory usage are measured over 50 independent runs. The results show that C, C++, and Rust consistently outperform higher-level languages in sequential and parallel execution, with Rust achieving competitive performance and the lowest peak memory consumption. Optimized numerical libraries substantially improve performance, reducing execution time by approximately 23.5× for C, 42.2× for Rust, and more than 4000× for Python compared with direct implementations. These findings demonstrate that practical computational performance depends not only on the programming language but also on compiler infrastructure, parallelization mechanisms, and the availability of optimized numerical libraries.
Keywords