Skip to content

Instantly share code, notes, and snippets.

@dwfait
Last active January 18, 2016 18:51
Show Gist options
  • Save dwfait/9add4b6442897d68a2cd to your computer and use it in GitHub Desktop.
Save dwfait/9add4b6442897d68a2cd to your computer and use it in GitHub Desktop.
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
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