Skip to content

Instantly share code, notes, and snippets.

@phiggins
Created July 25, 2011 07:54
Show Gist options
  • Save phiggins/1103732 to your computer and use it in GitHub Desktop.
Save phiggins/1103732 to your computer and use it in GitHub Desktop.
profile_dalli_multi_get.rb
require 'dalli'
require 'ruby-prof'
N = (ARGV.first || 1_000).to_i
puts "N == #{N}"
dstore = Dalli::Client.new('localhost:11211')
dstore.set('key1', 'value')
dstore.set('key2', 'value')
result = RubyProf.profile do
N.times { dstore.get_multi('key1', 'key3') }
end
printer = RubyProf::GraphHtmlPrinter.new(result)
File.open("profile.html", "w") do |f|
printer.print(f)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment