memcache-client vs memcached 2010

Mike Perham published this same shootout about a year ago. I needed this info for the day job. Since then, Mike has released dalli, a Ruby 1.9.2-targeted smaller, tighter memcache-client. So it’s time for Round 2. Fight!

Platform used was MacOSX 10.6.4 on a 3.06 Ghz Core 2 Duo MBP w/ memcached v1.4.5 and running Ruby 1.8.7.

memcached is v1, dalli v0.10.1, and memcache-client v1.8.5.

                                     user     system      total        real
set:plain:memcached              0.170000   0.210000   0.380000 (  0.810570)
set:plain:dalli                  1.680000   0.280000   1.960000 (  2.253942)
set:plain:memcache-client        1.880000   0.290000   2.170000 (  2.299018)

set:ruby:memcached               0.180000   0.210000   0.390000 (  0.814561)
set:ruby:dalli                   1.700000   0.260000   1.960000 (  2.039180)
set:ruby:memcache-client         1.930000   0.290000   2.220000 (  2.294238)

get:plain:memcached              0.180000   0.210000   0.390000 (  0.790628)
get:plain:dalli                  1.750000   0.290000   2.040000 (  2.113645)
get:plain:memcache-client        2.220000   0.300000   2.520000 (  2.695678)

get:ruby:memcached               0.190000   0.210000   0.400000 (  0.791203)
get:ruby:dalli                   1.740000   0.280000   2.020000 (  2.087606)
get:ruby:memcache-client         2.250000   0.300000   2.550000 (  2.613772)

missing:ruby:memcached           0.280000   0.230000   0.510000 (  0.890550)
missing:ruby:dalli               1.670000   0.290000   1.960000 (  2.076984)
missing:ruby:memcache-client     1.850000   0.290000   2.140000 (  2.236749)

mixed:ruby:memcached             0.370000   0.410000   0.780000 (  1.621562)
mixed:ruby:dalli                 3.310000   0.550000   3.860000 (  4.399427)
mixed:ruby:memcache-client       4.170000   0.600000   4.770000 (  5.000441)

We’re looking at almost a factor of 3 in favor of memcached. And both result sets were obtained using Benchmark.bmbm (I love that method name).

And now using Ruby 1.9.2:

set:plain:memcached              0.160000   0.220000   0.380000 (  0.804786)
set:plain:dalli                  1.200000   0.270000   1.470000 (  1.540213)
set:plain:memcache-client        1.440000   0.280000   1.720000 (  1.804081)

set:ruby:memcached               0.160000   0.210000   0.370000 (  0.800606)
set:ruby:dalli                   1.200000   0.270000   1.470000 (  1.537974)
set:ruby:memcache-client         1.530000   0.280000   1.810000 (  1.922806)

get:plain:memcached              0.150000   0.210000   0.360000 (  0.757057)
get:plain:dalli                  1.280000   0.300000   1.580000 (  1.645847)
get:plain:memcache-client        1.690000   0.300000   1.990000 (  2.101135)

get:ruby:memcached               0.160000   0.210000   0.370000 (  0.748016)
get:ruby:dalli                   1.290000   0.320000   1.610000 (  1.679947)
get:ruby:memcache-client         1.710000   0.300000   2.010000 (  2.157334)

missing:ruby:memcached           0.180000   0.210000   0.390000 (  0.790607)
missing:ruby:dalli               1.220000   0.300000   1.520000 (  1.583295)
missing:ruby:memcache-client     1.430000   0.280000   1.710000 (  1.785973)

mixed:ruby:memcached             0.310000   0.410000   0.720000 (  1.552239)
mixed:ruby:dalli                 2.500000   0.600000   3.100000 (  3.238964)
mixed:ruby:memcache-client       3.160000   0.590000   3.750000 (  4.054283)

And now native is only ~ 2x faster than Ruby. Interesting.

Posted by evan on Monday, October 25, 2010

blog comments powered by Disqus