diff options
| author | Randy Morgan <[email protected]> | 2012-03-26 04:17:55 -0700 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-03-26 04:17:55 -0700 |
| commit | b07ea515f85c9314ca4fa981cb9267693effa821 (patch) | |
| tree | 1fc548ff843cbce5e06db0c6133407f503d3e78c /test | |
| parent | 42f45f4138a1f71b19411fd8600f2a2bce67a46b (diff) | |
| parent | f6c3a491ef014914524a98259a8679a5e4f64d57 (diff) | |
| download | caxlsx-b07ea515f85c9314ca4fa981cb9267693effa821.tar.gz caxlsx-b07ea515f85c9314ca4fa981cb9267693effa821.zip | |
Merge pull request #64 from ochko/go-faster
Go faster
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 |
