Created
December 4, 2019 07:38
-
-
Save sbpipb/0529beafd8a2d48ab3c0385b3969da89 to your computer and use it in GitHub Desktop.
benchmarking shiz
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
Benchmark.ips do |bm| | |
bm.report("spy") { spy(User, id: 1) } | |
bm.report("double") { double(User, id: 1) } | |
bm.report("verifying double") { instance_double(User, id: 1) } | |
bm.report("actual object") { User.new(id: 1) } | |
bm.report("via factorygirl") { FactoryGirl.build(:user, id: 1) } | |
bm.compare! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment