Skip to content

Instantly share code, notes, and snippets.

@whatcould
Created April 13, 2009 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whatcould/94196 to your computer and use it in GitHub Desktop.
Save whatcould/94196 to your computer and use it in GitHub Desktop.
# cache read benchmark (about a 2k string)
# I get the actual memcache store from ActionController
cache = ActionController::Caching.send(:class_variable_get,:@@cache_store)
# and run the benchmark 100 times
ActionController::Base.benchmark "cache benchmark: " do
100.times do
cache.read('views/sightings/1624/row')
end
end
# =================
# First, with the "1.6.5" version bundled with rails 2.3
cache.instance_variable_get(:@data).class::VERSION
# => "1.6.4.99"
# => cache benchmark: (182.9ms)
# =====================
# I switch memcache_client versions:
cache.instance_variable_get(:@data).class::VERSION
# => "1.5.0"
# => cache benchmark: (18.6ms)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment