Skip to content

Instantly share code, notes, and snippets.

@jamster
Created August 8, 2011 13:51
Show Gist options
  • Select an option

  • Save jamster/1131767 to your computer and use it in GitHub Desktop.

Select an option

Save jamster/1131767 to your computer and use it in GitHub Desktop.
Memcached Miss Benchmarker
require 'rubygems'
require 'benchmark'
GC.disable
@mp = MemcachedPage.new
CRZ = 100000
CRZ.times do |x|
@mp.set("/#{x}", "Testing")
end
Benchmark.bm do |x|
x.report('Hits ') do
CRZ.times {|i| @mp.expire("/#{i}") }
end
x.report('Misses') do
CRZ.times {|i| @mp.expire("/TEST/#{i}") }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment