diff options
| author | Randy Morgan <[email protected]> | 2012-11-25 16:40:17 +0900 |
|---|---|---|
| committer | Randy Morgan <[email protected]> | 2012-11-25 16:40:17 +0900 |
| commit | e1589ceadb6edc277054a7069c1ba67ca7cef7b4 (patch) | |
| tree | e09937ad37639f3dde98b21d7b176bc80bcad340 /test/profile.rb | |
| parent | 818821bce3a3eb36e939d30acd47977a2ab99d9b (diff) | |
| download | caxlsx-e1589ceadb6edc277054a7069c1ba67ca7cef7b4.tar.gz caxlsx-e1589ceadb6edc277054a7069c1ba67ca7cef7b4.zip | |
Added note for ::CGI.escapeHTML performance issue
Diffstat (limited to 'test/profile.rb')
| -rw-r--r-- | test/profile.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/test/profile.rb b/test/profile.rb index bce5d74e..0190dc16 100644 --- a/test/profile.rb +++ b/test/profile.rb @@ -1,31 +1,22 @@ #!/usr/bin/env ruby -s -# -*- coding: utf-8 -*- # Usage: # > ruby test/profile.rb -# > pprof.rb --gif /tmp/axlsx_noautowidth > /tmp/axlsx_noautowidth.gif +# > pprof.rb --gif /tmp/axlsx > /tmp/axlsx.gif # > open /tmp/axlsx_noautowidth.gif $:.unshift "#{File.dirname(__FILE__)}/../lib" require 'axlsx' -require 'csv' - -# require 'benchmark' require 'perftools' row = [] +# Taking worst case scenario of all string data input = (32..126).to_a.pack('U*').chars.to_a 20.times { row << input.shuffle.join} times = 3000 -PerfTools::CpuProfiler.start("/tmp/axlsx_noautowidth") do +PerfTools::CpuProfiler.start("/tmp/axlsx") do p = Axlsx::Package.new - #p.use_autowidth = false - #p.use_shared_strings = true - wb = p.workbook - - #A Simple Workbook - - wb.add_worksheet do |sheet| + p.workbook.add_worksheet do |sheet| times.times do sheet << row end |
