Sha256: f64caece874e840640fe21a517483dca31ea6ca1542e102d1a9ef8e791481091

Contents?: true

Size: 856 Bytes

Versions: 5

Compression:

Stored size: 856 Bytes

Contents

require 'whysoslow'
require 'xmlss'

class XmlssBenchRunner

  attr_reader :result

  def initialize(n)
    @build = Proc.new do
      Xmlss::Workbook.new(Xmlss::Writer.new(:pp => 2), &Proc.new do
        worksheet("5 columns, #{n} rows") {
          column
          column
          column
          column
          column

          n.times do |i|
            row {
              # put data into the row (infer type)
              [1, "text", 123.45, "0001267", "$45.23"].each do |data_value|
                cell { data data_value }
              end
            }
          end
        }
      end).to_file("./bench/profiler_#{n}.xml")
    end

    @printer = Whysoslow::DefaultPrinter.new({
      :title => "#{n} rows",
      :verbose => true
    })

    @runner = Whysoslow::Runner.new(@printer)
  end

  def run
    @runner.run &@build
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
xmlss-1.0.1 bench/bench_runner.rb
xmlss-1.0.0 bench/bench_runner.rb
xmlss-1.0.0.rc.4 bench/bench_runner.rb
xmlss-1.0.0.rc.3 bench/bench_runner.rb
xmlss-1.0.0.rc.2 bench/bench_runner.rb