Sha256: 3632efdbf3c4a9fa22b9550d8fe8d792491f6e1c34577386cf7ec463f318b86c

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

#!/usr/bin/env ruby -s
# -*- coding: utf-8 -*-

# Usage:
# > ruby test/profile.rb
# > pprof.rb --gif /tmp/axlsx_noautowidth > /tmp/axlsx_noautowidth.gif
# > open /tmp/axlsx_noautowidth.gif

$:.unshift "#{File.dirname(__FILE__)}/../lib"
require 'axlsx'
require 'csv'

# require 'benchmark'
require 'perftools'
row = []
input = (32..126).to_a.pack('U*').chars.to_a
20.times { row << input.shuffle.join}
times = 1000

PerfTools::CpuProfiler.start("/tmp/axlsx_noautowidth") do
  p = Axlsx::Package.new
  p.use_autowidth = false
  wb = p.workbook
  
  #A Simple Workbook
  
  wb.add_worksheet do |sheet|
    times.times do
      sheet << row
    end
  end
  p.serialize("example.xlsx")
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
axlsx-1.1.0 test/profile.rb