Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. require 'benchmark'
  2.  
  3. n = 5_000_000
  4. Benchmark.bm do |x|
  5. x.report { n.times do ; { "x" => 1, "y" => 2}; end }
  6. x.report { n.times do ; { 'x' => 1, 'y' => 2}; end }
  7. end
  8.  
  9.  
  10. # first
  11. # user system total real
  12. # 3.820000 0.100000 3.920000 ( 3.941016)
  13. # 3.710000 0.070000 3.780000 ( 3.798138)
  14. # second
  15. # user system total real
  16. # 3.530000 0.080000 3.610000 ( 3.618199)
  17. # 3.540000 0.080000 3.620000 ( 3.631045)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement