diff options
| author | ochko <[email protected]> | 2012-03-26 20:02:51 +0900 |
|---|---|---|
| committer | ochko <[email protected]> | 2012-03-26 20:02:51 +0900 |
| commit | 6b0107b50e04bd57385860238a035f0752d2dad8 (patch) | |
| tree | bbca5ff1b3d2b3926445165490bc1155bb469760 /test | |
| parent | 42f45f4138a1f71b19411fd8600f2a2bce67a46b (diff) | |
| download | caxlsx-6b0107b50e04bd57385860238a035f0752d2dad8.tar.gz caxlsx-6b0107b50e04bd57385860238a035f0752d2dad8.zip | |
add perftools.rb
Diffstat (limited to 'test')
| -rw-r--r-- | test/profile.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/profile.rb b/test/profile.rb new file mode 100644 index 00000000..97d2e2bc --- /dev/null +++ b/test/profile.rb @@ -0,0 +1,33 @@ +#!/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 |
