Rewrite it in Rust: A Computational Physics Case Study
Willow Veytsman, Shuang Zhai, Chen Ding, Adam B. Sefkow

TL;DR
This paper evaluates Rust's effectiveness for scientific computing by comparing its performance and parallel programming ease to C++, demonstrating Rust's potential for faster and safer physics simulations.
Contribution
It provides the first detailed comparison of Rust and C++ in scientific computing, highlighting Rust's performance benefits and safe parallel programming capabilities.
Findings
Rust outperforms C++ in certain physics simulation tests with up to 5.6x speedup.
Parallel Rust code can be written safely and improves performance.
Preliminary profiling offers insights into performance differences.
Abstract
Surveys of computational science show that many scientists use languages like C and C++ in order to write code for scientific computing, especially in scenarios where performance is a key factor. In this paper, we seek to evaluate the use of Rust in such a scenario, through implementations of a physics simulation in both C++ and Rust. We also create a parallel version of our Rust code, in order to further explore performance as well as parallel code complexity. Measuring performance as program runtime, we find that Rust can offer better performance than C++, with some test cases showing as much as a 5.6 performance increase, and that parallel code in Rust can further improve performance while being easy to write safely. Finally, we provide some preliminary profiling to better understand the difference between the way our implementations perform.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsCrop Yield and Soil Fertility
