Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



> 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.)


Ok, 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.


The Rust implementation hasn't been extensively microoptimised.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: