Created
February 15, 2013 20:58
-
-
Save tjsingleton/4963489 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/ips' | |
require_relative '../config/environment' | |
Benchmark.ips do |x| | |
x.report("without patch - by slug") { | |
User.uncached do | |
User.find("tj-singleton") | |
end | |
} | |
x.report("without patch - by id") { | |
User.uncached do | |
User.find("1") | |
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
Calculating ------------------------------------- | |
with patch - by slug 82 i/100ms | |
with patch - by id 97 i/100ms | |
------------------------------------------------- | |
with patch - by slug 999.0 (±27.9%) i/s - 4428 in 5.059986s | |
with patch - by id 1112.1 (±30.2%) i/s - 4947 in 5.114582s |
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
Calculating ------------------------------------- | |
without patch - by slug | |
56 i/100ms | |
without patch - by id | |
32 i/100ms | |
------------------------------------------------- | |
without patch - by slug | |
672.1 (±29.9%) i/s - 3024 in 5.105228s | |
without patch - by id | |
358.0 (±30.4%) i/s - 1536 in 5.004642s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Niiiiiiice