3 ms·
Are you sure you're not confusing it with Swift, or perhaps running Rust in unoptimized debug mode (-O0)? Rust goes as low-level as C (there's literally c2rust
by pornel 4y ago
Are you sure you're not confusing it with Swift, or perhaps running Rust in unoptimized debug mode (-O0)?
Rust goes as low-level as C (there's literally c2rust source-to-source translator). It gives you full control over all allocations and indirections. It's even more efficient than C++ in a few places, e.g. it has a more efficient ABI for unique_ptr, doesn't call destructors redundantly after a move, doesn't need isa pointer in structs with virtual methods.
Rust generates native code using LLVM, and even has a bit stricter semantics that allow better optimizations (notably immutability and mutable aliasing are stricter than in C and C++).