5 ms·
There are actually cases where Rust is faster than C already, one of the reasons being the compiler emitting better code thanks to mutable aliasing being forbid
by brohee 12y ago
There are actually cases where Rust is faster than C already, one of the reasons being the compiler emitting better code thanks to mutable aliasing being forbidden.
http://benchmarksgame.alioth.debian.org/u64q/rust.html http://benchmarksgame.alioth.debian.org/u64q/rust.html
- zzzcpan 12y agoIt's not why C is faster, it's more about being able to use hand crafted SSE2 instructions and existing libraries with such optimizations. Nothing competes with C when performance really matters.
- krenoten 12y agoFeel free to use the asm! macro in rust when you need to. FFI support is also quite good.
- pcwalton 12y agoYou can use "hand-crafted" SSE2 instructions and libraries with the same in Rust. Servo heavily relies on Skia, for example…
- hetman 12y agoTechnically Fortran does compete. For computational applications it is faster than C and hence why it's so popular in supercomputing.
- bjz_ 12y agoThere is also a case for making highly optimized C performance easier to attain, without needing to resort to unsafe code. You can do this by providing more invariants to the compiler via a better type system, which gives it more room to optimize. It may never get to the performance of hand-optimized stuff, but for that there is unsafe code blocks.
- deleted 12y ago[deleted]