Created
March 23, 2009 01:16
-
-
Save brynary/83366 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" | |
x = 10_000 | |
first_id = Sport.first.id | |
key = "Sport:#{first_id}" | |
Sport.set key, Sport.find(first_id) # prime cache | |
Benchmark.bm(20) do |b| | |
b.report "Sport.get" do | |
x.times do | |
Sport.get key | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment