3 ms·
Yes, the most recent example I can think of is http://cliffle.com/p/dangerust/ http://cliffle.com/p/dangerust/ in which the author translates heavily optimized
by K0nserv 7y ago
Yes, the most recent example I can think of is http://cliffle.com/p/dangerust/ http://cliffle.com/p/dangerust/ in which the author translates heavily optimized C to Rust in a quite mechanical way. It comes out being slightly faster. In the last part they rewrite it in idomatic Rust and it ends up even faster again without any of the bespoke optimizations that the C code used or any unsafe Rust.
In many instances the Rust type system should allow the compiler to emit faster code because it has more data to use for reasoning about valid and invalid states of the program. Depending on how good c2rust is the Rust version should be roughly as fast, refactored to idomatic Rust it could be meaningfully faster than C.