Created
April 13, 2009 01:12
-
-
Save whatcould/94196 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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