Saved in:
| Main Authors: | , , , |
|---|---|
| Format: | Preprint |
| Published: |
2024
|
| Subjects: | |
| Online Access: | https://arxiv.org/abs/2410.19146 |
| Tags: |
Add Tag
No Tags, Be the first to tag this record!
|
| _version_ | 1866929558008102912 |
|---|---|
| author | Veytsman, Willow Zhai, Shuang Ding, Chen Sefkow, Adam B. |
| author_facet | Veytsman, Willow Zhai, Shuang Ding, Chen Sefkow, Adam B. |
| contents | 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$\times$ 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. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2410_19146 |
| institution | arXiv |
| publishDate | 2024 |
| record_format | arxiv |
| spellingShingle | Rewrite it in Rust: A Computational Physics Case Study Veytsman, Willow Zhai, Shuang Ding, Chen Sefkow, Adam B. Computational Physics 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$\times$ 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. |
| title | Rewrite it in Rust: A Computational Physics Case Study |
| topic | Computational Physics |
| url | https://arxiv.org/abs/2410.19146 |