Skip to content

Instantly share code, notes, and snippets.

@dwfait
Last active January 15, 2016 17:39
Show Gist options
  • Save dwfait/780e34f4916dd0aa5aeb to your computer and use it in GitHub Desktop.
Save dwfait/780e34f4916dd0aa5aeb to your computer and use it in GitHub Desktop.
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
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