Sha256: beb664f6cc4f2f2680457c11990ec1600eeb91a6e78c628bdaffdc1c23fce97d
Contents?: true
Size: 851 Bytes
Versions: 5
Compression:
Stored size: 851 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 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
Version data entries
5 entries across 5 versions & 2 rubygems