Advertisement
Guest User

Untitled

a guest
Jun 29th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. ```ruby
  2.  
  3. Rehearsal ------------------------------------------
  4. rubyXL 0.040000 0.010000 0.050000 ( 0.041210)
  5. creek 0.010000 0.000000 0.010000 ( 0.014644)
  6. roo 0.020000 0.000000 0.020000 ( 0.022531)
  7. --------------------------------- total: 0.080000sec
  8. user system total real
  9. rubyXL 0.030000 0.000000 0.030000 ( 0.029768)
  10. creek 0.010000 0.000000 0.010000 ( 0.012902)
  11. roo 0.020000 0.000000 0.020000 ( 0.015530)
  12.  
  13. require 'benchmark'
  14. require 'rubyXL'
  15. require 'creek'
  16. require 'roo'
  17.  
  18. file_path = ARGV[0]
  19. Benchmark.bmbm(6) do |x|
  20.  
  21. x.report 'rubyXL' do
  22. workbook = RubyXL::Parser.parse(file_path)
  23. worksheet = workbook[0]
  24. worksheet.each do |row|
  25. row.cells.each { |c| c }
  26. end
  27. end
  28.  
  29. x.report 'creek' do |x|
  30. book = Creek::Book.new(file_path)
  31. sheet = book.sheets[0]
  32. sheet.rows.each do |row|
  33. row.each { |c| c }
  34. end
  35. end
  36.  
  37. x.report 'roo' do |x|
  38. book = Roo::Spreadsheet.open(file_path)
  39. sheet = book.sheet(0)
  40. sheet.each_row_streaming do |row|
  41. row.each { |c| c }
  42. end
  43. end
  44.  
  45. end
  46. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement