Re:Why is Rust slightly slower than C?
by mlindner on Wednesday September 11, 2019 @10:34PM
(#20947268)
Please don't answer the question if you don't know enough to answer it. Rust doesn't have exception handling. Rust doesn't have a runtime.
[ Parent
| on HN ]
Re:Why is Rust slightly slower than C?
by maxk42 on Wednesday September 18, 2019 @03:13PM
(#21008883)
Yes, rust has a runtime. Even most assemblers have runtimes these days.
Take a look at this: https://imgur.com/lPOPj1G
You see that difference? That's not rust producing less-efficient code. That's the more complex rust runtime.
Think it's an artifact of static linkage? Guess again.
But IIRC rust doesn't statically link glibc by default.
So the difference in runtime overhead is more than 10x the machine code size. That doesn't translate to a 10x slowdown and a lot of that is probably baked-in optimization but rust certainly has a runtime and associated overhead and it has a lot larger runtime than C.