Created
April 23, 2015 13:07
-
-
Save matsubo/d440e25f013ff59356f9 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
require 'benchmark' | |
require 'redis' | |
require 'securerandom' | |
hosts = { | |
:docker => { :host => '172.17.8.102', :port => 6379 }, | |
:virtualbox => { :host => '33.33.11.10', :port => 6379 }, | |
} | |
hosts.each do |key, host| | |
puts key | |
redis = Redis.new(:host => host[:host], :port => host[:port], :db => 15) | |
n = 5000 | |
Benchmark.bm do |x| | |
x.report('set') { n.times do ; redis.set SecureRandom.hex(10), SecureRandom.hex(10) ; end } | |
x.report('get') { n.times do ; redis.get SecureRandom.hex(10) ; end } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result