|
|
|
|
|
by Manishearth
3663 days ago
|
|
Rust can use simd too. It doesn't in those benchmarks. Please apply the common sense you keep harping about. Claiming rust is 2x slower because of that benchmark is a falsehood. Re:regex: my point exactly. Most microbenchmarks are prone to slight differences in the implementation causing issues (and you can rarely translate code exactly, especially to something like rust which often requires a different structure of code from C. Same for any two other langauges). 19% is well within this error box. The fast_blank thing is this example. fast_blank is a carefully hand optimized C extension whose main purpose is being super fast. A mostly naive Rust one-liner beat it (not by much iirc, perhaps 10%, but thats within the error box im talking about). It didn't use parallelism or anything fancy. They weren't even trying to beat C. I provided this proof already. I could try fixing that benchmark you linked to -- the rust version looks like it could be optimized further. Not sure if its worth it, really. I don't put much stock in microbenchmarks for anything other than order of magnitude comparisons. |
|
No it can't. Either accept that the nightly build of Rust is not the Rust we are talking about or stop discussing with me.
> Re:regex: my point exactly.
The problem with regex libraries are that they are to big so therefore doesn't reveal so much about inherent language performance.
> Most microbenchmarks are prone to slight differences in the implementation causing issues (and you can rarely translate code exactly, especially to something like rust which often requires a different structure of code from C. Same for any two other langauges).
Yes, obviously the implementation defines performance. That's what I wrote in the other thread part: "this discussion is about Rust vs C. Or rather clang 3.6.2/gcc 5.2.1 vs Rust 1.9.0 since language performance is very implementation dependent"
And fwiw, you can easily transliterate C code to C++ or to asm.
> 19% is well within this error box.
What error box? 19% is a huge difference.
> The fast_blank thing is this example. fast_blank is a carefully hand optimized C extension whose main purpose is being super fast.
I don't know what fast_blank is. Is it this https://github.com/SamSaffron/fast_blank/blob/master/ext/fas... C code wycatz managed to rewrite faster in Rust? That C code isn't well-optimized at all...
> I don't put much stock in microbenchmarks for anything other than order of magnitude comparisons.
Does that mean it is impossible to prove to you that C is at least 2x faster than Rust since twice is less than one order of magnitude?