Created
August 16, 2011 00:03
-
-
Save chrislloyd/1148175 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 'digest/md5' | |
n = 10000 | |
redis = Redis.new | |
Benchmark.bm do |bm| | |
bm.report do | |
n.times { Digest::MD5.hexdigest 'christopher.lloyd@gmail.com' } | |
end | |
redis.set 'benchmark:gravatastic', | |
Digest::MD5.hexdigest('christopher.lloyd@gmail.com') | |
bm.report do | |
n.times { redis.get 'benchmark:gravatastic' } | |
end | |
end |
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
user system total real | |
0.020000 0.000000 0.020000 ( 0.026320) | |
0.390000 0.280000 0.670000 ( 1.691016) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment