Instantly share code, notes, and snippets.

Embed
What would you like to do?
require 'benchmark'
N = 1_000_000
Benchmark.bm(10) { |x|
0.step(to: 16) { |size|
data = (1..size).zip(Array.new(size))
x.report(size) {
i = 0
while i < N
Hash[data]
i += 1
end
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment