When SIMD goes stable rust may dominate that game. Still wish they would use clang so it was apples to apples with c and c++. Edit: actually I wish they would add clang for those languages and leave GCC for comparison. Then I'd want FORTRAN to add gfortran for the same reason.
New Rust hash table leads Benchmarks Game
31–40 of 156 posts
Re: New Rust hash table leads Benchmarks Game
#32It is new Rust hash table from external crate.
Re: New Rust hash table leads Benchmarks Game
#33Re: New Rust hash table leads Benchmarks Game
#34Earlier quoted context omitted.
Is there any reason why we can't have a "C clang"? Or has just nobody bothered yet?
Circa 2011 the maintainer of the benchmark game decided to mostly only allow one implementation of each language[0] following pypy developers trying to get program alternatives which weren't pypy-pessimal. [0] some languages get a bye for some reason e.g. MRI and JRuby, but no pypy, and which implementation is blessed is also arbitrary e.g. javascript is v8 but lua is lua.
C needs to defend its reputation now!
Re: New Rust hash table leads Benchmarks Game
#35It is new Rust hash table from external crate.
The default hash table has better security against malicious input by using a slower hashing algorithm. Its the right default, but if you really want performance and to compete with C/C++, you have to use an algorithm that makes different tradeoffs, or you would be comparing apples to oranges.
Do the other programs use that same hash table algorithm?
http://www.sebastiansylvan.com/post/robin-hood-hashing-shoul...
Re: New Rust hash table leads Benchmarks Game
#36It seems to me that there are a lot of apples-to-oranges comparisons here? Some implementations are using the language's standard library hashtable implementation while others are using 3rd party version (with different algorithms and data structures across all of them), some are using multiple threads while others are single threaded etc. As a result, I wouldn't read too much into the rankings you see here.
And some languages are allowed to use FFI to make their impl faster. There's some rule about this that I don't understand, but oh well. It's all for fun, not serious. But come on, now Rust can legitimately be called "faster than C" ;) At least until the Clang C version is added... or maybe it will still be faster.
Actually it's pretty easy: if you can write a faster version in any language, given whatever is there in the language, even if it's c implemented standard library stuff, do it.
The implementations are not meant to be final -- people can contribute faster ones.
Re: New Rust hash table leads Benchmarks Game
#37It is new Rust hash table from external crate.
The default hash table has better security against malicious input by using a slower hashing algorithm. Its the right default, but if you really want performance and to compete with C/C++, you have to use an algorithm that makes different tradeoffs, or you would be comparing apples to oranges.
I think an adaptive hash that switches from fast to secure when collisions are detected would make a better default choice (at the cost of some implementation complexity).
Or possibly even an implementation with log(n) worst case complexity.
Re: New Rust hash table leads Benchmarks Game
#38Re: New Rust hash table leads Benchmarks Game
#39The rust version is using multiple cpus using a pool concept (which looks a lot like the multiprocessing module from python so kudos there). But the C version is single threaded from what I can tell. So rust is safe but threaded to be faster than single threaded C which isn't that much slower. Hmm...
That's not true. If you look at the comparisons, the cpu time taken by C is actually more than rust, and the cpu load looks about even. Note the C version uses: #pragma omp parallel sections
318% is 20% bigger then 265%.
Re: New Rust hash table leads Benchmarks Game
#40Does this have anything to do with: https://news.ycombinator.com/item?id=13742865 ?