Created
July 1, 2019 10:19
-
-
Save madwork/8a370de02de8214bbbfcce8a539ee365 to your computer and use it in GitHub Desktop.
This file contains hidden or 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| | |
x.report("Kernel") { Hash(nil) } | |
x.report("Hash") { Hash.new(nil) } | |
end | |
# Warming up -------------------------------------- | |
# Kernel 307.226k i/100ms | |
# Hash 117.067k i/100ms | |
# Calculating ------------------------------------- | |
# Kernel 9.192M (± 5.7%) i/s - 46.084M in 5.029888s | |
# Hash 1.729M (± 7.8%) i/s - 8.663M in 5.039179s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment