Last active
January 18, 2016 18:51
-
-
Save dwfait/9add4b6442897d68a2cd 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 124.917k i/100ms | |
new 127.378k i/100ms | |
------------------------------------------------- | |
old 3.766M (± 5.0%) i/s - 18.862M | |
new 3.797M (± 4.8%) i/s - 18.979M | |
Comparison: | |
new: 3797241.3 i/s | |
old: 3765728.9 i/s - 1.01x 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