Measuring the Execution Times of C Versus Rust | by Aaron Beckley | Jan, 2025

Editor
2 Min Read


Comparing two of the fastest programming languages

Photo by Aron Visuals on Unsplash

Is C is faster than Rust? I had always assumed the answer to that question to be yes, but I recently felt the need to test my assumptions. I tried searching for information on the subject but I wasn’t able to find information that compared the two languages side by side, so I did my own testing. What I found were cases where Rust could be seen as faster than C.

C and Rust are both similar (low-level) system programming languages designed for high performance; where they differ is in their design philosophy and features.

  • C is about simplicity and giving the programmer complete control over memory. With this freedom can come potential issues such as buffer overflows, null pointer dereferencing, and memory leaks if the programmer does not handle these properly in their code. It lacks built-in safety features to prevent these, and the user has to make them manually.
  • Rust is the polar opposite of this and it emphasizes memory safety while trying to sacrifice as little performance as possible. It uses a borrow checker and ownership system to enforce rules at compile-time to ensure that memory is accessed safely.
Share this Article
Please enter CoinGecko Free Api Key to get this plugin works.