Last active
January 15, 2016 17:31
-
-
Save dwfait/c1f211c0d9201d087cc3 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 317.000 i/100ms | |
new 14.732k i/100ms | |
------------------------------------------------- | |
old 3.189k (± 3.4%) i/s - 16.167k | |
new 158.659k (± 3.1%) i/s - 795.528k | |
Comparison: | |
new: 158658.9 i/s | |
old: 3189.4 i/s - 49.75x 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 = (1..10000).to_a | |
a2 = (1..10000).to_a | |
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