Memcache-client Performance

2009-02-15

One email I get fairly regularly is “Why would I use memcache-client when the performance sucks?” Most people point me to Evan Weaver’s BENCHMARKS file in his memcached library as proof that I should just close up shop.

His benchmarks, like all performance tests, are a snapshot in time – they reflect a certain revision of the codebase. Specifically I assume his benchmarks reflect memcache-client 1.5.0. This version is about 18 months old and ships with Rails 2.x. Since 1.5.0, I’ve taken over the project and done a lot of tuning. Here’s some numbers:

You can see the exact benchmark code in memcache-client/test/test_benchmark.rb. It’s basically just a direct copy of Evan’s benchmarks, modified to run as part of the test suite. This is running in Ruby 1.8.6 p114 on a 2.2Ghz Core 2 Duo. The numbers for Ruby 1.9.1 are approx 20% faster.

The latest numbers are not orders of magnitude slower but rather merely some percentage off. So while Evan’s numbers are correct for an old version of memcache-client, they do not represent the current state of the project. It’s my belief that memcache-client 1.6.x has perfectly acceptable performance and in return, you get a mostly pure Ruby codebase that works on JRuby, Ruby 1.8 and Ruby 1.9. I hope this clears up any confusion; let me know if you have further questions!