Sha256: da8f03a1fa21f1e29c29f168031d423422ff3e01742295c8f339c338f47bcab0

Contents?: true

Size: 422 Bytes

Versions: 5

Compression:

Stored size: 422 Bytes

Contents

require 'benchmark'
require_relative '../../lib/hyper_iterator'
$stdout.sync = true

puts
puts '----------------- Array#each ------------------'
puts '#i    user      system      total       real'

base_arr = Array.new(10000) { '-' * 10 }
arrs = [base_arr]

i = 0
while true
  print "#{i} "
  arr = []
  report = Benchmark.measure do
    arrs[i].each { |el| arr << el.dup }
  end

  puts report
  arrs << arr
  i += 1
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hyper_iterator-0.3.1 benchmark/memory_bm/each.rb
hyper_iterator-0.3.0 benchmark/memory_bm/each.rb
hyper_iterator-0.2.2 benchmark/memory_bm/each.rb
hyper_iterator-0.2.1 benchmark/memory_bm/each.rb
hyper_iterator-0.2.0 benchmark/memory_bm/each.rb