Earlier quoted context omitted.
Probably because people are intelligent enough not to compare speeds inside of a vacuum. When someone denigrates a language as "java-like" they're really just comparing it anecdotally to the sum of all Java projects they've worked with. Rarely is the project a single-purpose, optimized pet-project.
Smalltalk was long castigated for being a "slow, poky interpreted language" long, long after it stopped being that in fact. In all of my time as a consultant for the language vendor, never did I ever come across the VM actually being too slow. In something like 90% of the cases, it was due to IO. Before I left the Smalltalk part of my career behind, someone had the occasion to compare the parser-compiler of one Small…
New Rust hash table leads Benchmarks Game
151–156 of 156 posts
Re: New Rust hash table leads Benchmarks Game
#152Earlier quoted context omitted.
There's been a good deal of play, flex and slop in the interpretation of "use the same algorithm" for some of those tasks. I think your point is more that "Don't optimize away the work." is antithetical to what we do.
All of the benchmark game problems either prescribe using a fixed algorithm or have an obvious optimal asymptotic complexity. The remaining challenge is generally to reduce the constant factor as much as possible. This is just not what a lot of computationally expensive problems look like in practice. As a simple example, any practical solution for an NP-hard problem will be full of tradeoffs; often you just want som…
Re: New Rust hash table leads Benchmarks Game
#153Earlier quoted context omitted.
Yeah. But in this kind of tuned benchmark, I doubt clang will do any better across the board - especially not considering the fact that the current programs are likely to be at least somewhat tuned specifically for gcc.
Clang does well enough to be the default compiler for Apple and Google. It can't be that far behind.
But... trial and error and all ;-).
Re: New Rust hash table leads Benchmarks Game
#154> Some language implementations have hash tables built-in; some provide a hash table as part of a collections library; some use a third-party hash table library. (For example, use either khash or CK_HT for C language k-nucleotide programs.) The hash table algorithm implemented is likely to be different in different libraries. > Please don't implement your own custom "hash table" - it will not be accepted. > The work…
So thanks for that!
Re: New Rust hash table leads Benchmarks Game
#155Earlier quoted context omitted.
For what it's worth, this alternate implementation has only one line of unsafe code (a call to the libc "memchr" function) and is only 9% slower than the fastest unsafe version: https://github.com/mbrubeck/benchmarksgame-rs/blob/reverse_c... It's very easy to write extremely fast safe Rust code. (The safe Rust version above is faster than the fastest C++ submission, on my computer.) Using "unsafe" for optimization is…
Wonderful, thank you! Producing the safe versions which are that efficient is really the best argument for Rust that I can imagine.
Re: New Rust hash table leads Benchmarks Game
#156Earlier quoted context omitted.
Wonderful, thank you! Producing the safe versions which are that efficient is really the best argument for Rust that I can imagine.
As an update, this pull request now removes most of the unsafe code: https://github.com/TeXitoi/benchmarksgame-rs/pull/46