Sha256: 5b04b88b3455dc0d0ed946d2563f2f6cf6ab80e8be1ebf6cb7446978a30b0d0f

Contents?: true

Size: 947 Bytes

Versions: 5

Compression:

Stored size: 947 Bytes

Contents

require_relative 'init'

HEADERS = ["id", "name", "age", "date", "random"]

DATA = []
10_000.times do |n|
  DATA << [n, "String string #{n}" * 5, (n * rand * 10).round, Time.at(n * 1000 + 1492922688), n * 100]
end

puts "warm up..."
write_fast_excel_20k
write_axlsx_20k
write_xlsx_20k
write_xlsxtream_20k

DATA.clear
50_000.times do |n|
  DATA << [n, "String string #{n}" * 5, (n * rand * 10).round, Time.at(n * 1000 + 1492922688), n * 100]
end

GC.start
sleep 5

def measure_memory(title)
  puts "Running test: #{title}"
  recorder = ProcessMemory.start_recording
  yield
  puts recorder.print("Done!")
  recorder.stop
  puts recorder.report_per_second_pretty
  puts
end

measure_memory("FastExcel") do
  write_fast_excel_20k
end

GC.start
sleep 5

measure_memory("Axlsx") do
  write_axlsx_20k
end

GC.start
sleep 5

measure_memory("write_xlsx") do
  write_xlsx_20k
end

GC.start
sleep 5

measure_memory("xlsxtream") do
  write_xlsxtream_20k
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
fast_excel-0.5.0 benchmarks/memory.rb
fast_excel-0.4.1 benchmarks/memory.rb
fast_excel-0.4.0 benchmarks/memory.rb
fast_excel-0.3.0 benchmarks/memory.rb
fast_excel-0.2.6 benchmarks/memory.rb