Time to rank 10 million people in a leaderboard (sequential scores): 794.157420158386
Time to rank 10 million people in a leaderboard (random scores): 849.301838159561
Average time to retrieve an arbitrary page from the leaderboard (50,000 requests): 0.00165219999999999
Time to rank 10 million people in a leaderboard (sequential scores): 656.387526
Time to rank 10 million people in a leaderboard (random scores): 748.955826
Average time to retrieve an arbitrary page from the leaderboard (50,000 requests): 0.0011321999999999895
Ruby 1.9.3Time to rank 10 million people in a leaderboard (sequential scores): 651.057383
Time to rank 10 million people in a leaderboard (random scores): 719.157958
Average time to retrieve an arbitrary page from the leaderboard (50,000 requests): 0.001079199999999996
SummaryRuby 1.8.7 to Ruby 1.9.3 (sequential scores): 18% improvement
Ruby 1.8.7 to Ruby 1.9.3 (random scores): 15% improvement
Ruby 1.8.7 to Ruby 1.9.3 (average page request): 34% improvement
Switching Redis Client Library I decided not to benchmark Ruby 1.8.7 or Ruby 1.9.2 in tweaking the client driver "knob". Below are the benchmark results using Ruby 1.9.3 with the hiredis-rb client library. Values are in seconds. Ruby 1.9.3 and hiredisTime to rank 10 million people in a leaderboard (sequential scores): 472.544572
Time to rank 10 million people in a leaderboard (random scores): 549.911350
Average time to retrieve an arbitrary page from the leaderboard (50,000 requests): 0.0003803999999999928
SummaryRuby 1.8.7 to Ruby 1.9.3/hiredis (sequential scores): 40% improvement
Ruby 1.8.7 to Ruby 1.9.3/hiredis (random scores): 35% improvement
Ruby 1.8.7 to Ruby 1.9.3/hiredis (average page request): 76% improvement
Ruby 1.9.3 to Ruby 1.9.3/hiredis (sequential scores): 27% improvement
Ruby 1.9.3 to Ruby 1.9.3/hiredis (random scores): 23% improvement
Ruby 1.9.3 to Ruby 1.9.3/hiredis (average page request): 64% improvement
Wrap-Up It seems every aspect of video game technology is tweaked to maximize performance, whether it be frames per second or requests per second. Fiddling with very basic "knobs" here, I was able to get decent improvements in writing to and reading from a leaderboard of non-trivial size. Further speed improvements could potentially be realized by using a socket-based connection versus a TCP-based connection as well as faster hardware optimized for a server environment versus an off-the-shelf laptop. Thanks for indulging my leaderboard nerdery yet again. You can find more hilarity over on my Twitter account, @CzarneckiD. [This piece was reprinted from #AltDevBlogADay, a shared blog initiative started by @mike_acton devoted to giving game developers of all disciplines a place to motivate each other to write regularly about their personal game development passions.]