Why is Rust slightly slower than C?
C is the wrong language to compare to. More precisely, Rust should be able to <i>beat</i> C, routinely. Presumably it will, when it gets more optimizer attention. With any luck, that improvement can go into LLVM proper, and speed up many other languages besides.<p>Why should Rust beat C? First, it does not suffer from the pointer aliasing faults C has. Second, const really means const, where in C the compiler has to assume any pointer-to-const might be use to write through. Because alias analysis is ironclad, copies can be elided even if some function borrows a reference to the copy.<p>At a larger scale, improved abstraction tools mean more powerful libraries may be written and used, that would be unavailable to the C coder.<p>It is routine for C++ programs to be substantially faster than a C program that attempts the same job, even though C++ suffers from the same aliasing flaws C has. In the finance world, you would be laughed out of the room for proposing C for a performance-critical task.<p>This is why articles about other languages comparing them to some fraction of C performance are amusing. C is a low bar. If you can&#x27;t beat C, you are Doing It Wrong. In Rust&#x27;s case, that would be &quot;<i>still</i> doing it wrong&quot;; we may assume fixing this is on the schedule, after various &quot;getting it right&quot; and &quot;compiling faster&quot; goals are met.