Last active
January 15, 2016 17:39
-
-
Save dwfait/780e34f4916dd0aa5aeb 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
Calculating ------------------------------------- | |
old 127.212k i/100ms | |
new 126.136k i/100ms | |
------------------------------------------------- | |
old 3.772M (± 8.8%) i/s - 18.573M | |
new 3.951M (± 5.8%) i/s - 19.803M | |
Comparison: | |
new: 3951356.5 i/s | |
old: 3771768.5 i/s - 1.05x slower |
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' | |
Benchmark.ips do |x| | |
a1 = Array.new(100000, Object.new) | |
a2 = Array.new(100000, Object.new) | |
x.report("old") do | |
a1.eql? a2 | |
end | |
x.report("new") do | |
a1.new_eql? a2 | |
end | |
x.compare! | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment