With a 1000 rows .xlsx file
Rehearsal ------------------------------------------
rubyXL 0.540000 0.010000 0.550000 ( 0.552050)
creek 0.330000 0.000000 0.330000 ( 0.327936)
roo 0.410000 0.020000 0.430000 ( 0.425322)
--------------------------------- total: 1.310000sec
user system total real
rubyXL 0.520000 0.000000 0.520000 ( 0.521278)
creek 0.310000 0.000000 0.310000 ( 0.314996)
roo 0.360000 0.000000 0.360000 ( 0.371896)
require 'benchmark'
require 'rubyXL'
require 'creek'
require 'roo'
file_path = ARGV[0]
Benchmark.bmbm(6) do |x|
x.report 'rubyXL' do
workbook = RubyXL::Parser.parse(file_path)
worksheet = workbook[0]
worksheet.each do |row|
row.cells.each { |c| c }
end
end
x.report 'creek' do |x|
book = Creek::Book.new(file_path)
sheet = book.sheets[0]
sheet.rows.each do |row|
row.each { |c| c }
end
end
x.report 'roo' do |x|
book = Roo::Spreadsheet.open(file_path)
sheet = book.sheet(0)
sheet.each_row_streaming do |row|
row.each { |c| c }
end
end
end