[This is part of the Wide Finder 2 series.] I have now done the first “official” run of the naive Ruby implementation of the benchmark. There is some discussion of the code here. The benchmark is described, and the naive Ruby code provided, here. I’ve started a results page here. There are already ten eleven other people now with accounts on the Wide Finder machine, and I know there’ve been results that are hugely better than this first cut. Read on for a couple of notes on this first run.

The combination of using the SPARC-optimized Ruby and eliminating the huge sort shaved over four hours off the implementation time, but the results are still horrible: 25:24:41 elapsed time, with zero use of parallelism. The only thing that’s nice is the size: 78 lines of Ruby.

Can you do better on the time without exploding the code size?

An amusing note on the code. I needed a method to select the ten highest values (and corresponding keys) out of the hash table without sorting all of them. The code isn’t rocket science, here’s the skeleton:

class Hash def top(howmany) ... end end # ... later on @clients = {} ... @clients[client] += 1 ... top_clients = @clients.top(10)