Created
July 8, 2013 08:55
-
-
Save dented/5947281 to your computer and use it in GitHub Desktop.
random benchmarking
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
main_hash = {} | |
time = Benchmark.realtime do | |
Profiler__::start_profile | |
(1..10000).each do |number| | |
simple_hash = {} | |
simple_hash[number.to_s] = number | |
main_hash = main_hash.merge(simple_hash) | |
end | |
Profiler__::stop_profile | |
Profiler__::print_profile($stderr) | |
end | |
puts "Time elapsed #{time} seconds" | |
puts "Main hash key count: #{main_hash.keys.count}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment