Sha256: 53962edb9ed2612bf4ae821fbc4dac5209f45ef1079bc3a9a499bfa27ad44bc2

Contents?: true

Size: 469 Bytes

Versions: 2

Compression:

Stored size: 469 Bytes

Contents

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

puts
puts '-------------- Array#each_slice! --------------'
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_slice!(100) do |sl|
      sl.each { |el| arr << el.dup }
    end
  end

  puts report
  arrs << arr
  i += 1
end

puts

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hyper_iterator-0.3.1 benchmark/memory_bm/each_slice_bang.rb
hyper_iterator-0.3.0 benchmark/memory_bm/each_slice_bang.rb