5 ms·
> Why is C so much faster? Because processors are made with C in mind, as it's the lingua franca, and so they end up being optimized for it.
by innguest 13y ago
> Why is C so much faster?
Because processors are made with C in mind, as it's the lingua franca, and so they end up being optimized for it.
- Ygg2 13y agoOk, but why is Python faster than Rust implementation? (And yes, I assume those are C libs behind python). NOTE: Rust is supposed to have zero cost abstractions. I think this is more to lack of optimization on regexp part, than some fault of language.
- dbaupp 13y agoThe Rust implementation hasn't been extensively microoptimised.
- pcwalton 13y ago> Because processors are made with C in mind, as it's the lingua franca, and so they end up being optimized for it. No, Rust exposes the C memory model pretty directly, and it uses the backend of an industrial-strength C++ compiler (clang/LLVM). The difference here is algorithmic. (Rust does have some codegen bugs that affect performance, however, though I suspect they won't affect this code.)