summaryrefslogtreecommitdiffhomepage
path: root/test/profile.rb
diff options
context:
space:
mode:
authorRandy Morgan <[email protected]>2013-04-12 08:45:13 +0900
committerRandy Morgan <[email protected]>2013-04-12 08:45:23 +0900
commitfb67e06a5f4087ebee347867c13aa85c7d8db56d (patch)
treeb608fdb1a64ff7b91eec0f1cb9afb0f819ea6fd4 /test/profile.rb
parent21fd9b466e86d1352983ae3e13c163cd3517d8a9 (diff)
downloadcaxlsx-fb67e06a5f4087ebee347867c13aa85c7d8db56d.tar.gz
caxlsx-fb67e06a5f4087ebee347867c13aa85c7d8db56d.zip
Updated profile to use ruby-prof as we are in 2.0 for dev these days.
Diffstat (limited to 'test/profile.rb')
-rw-r--r--test/profile.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/test/profile.rb b/test/profile.rb
index 8e4218fd..91b0507f 100644
--- a/test/profile.rb
+++ b/test/profile.rb
@@ -7,20 +7,19 @@
$:.unshift "#{File.dirname(__FILE__)}/../lib"
require 'axlsx'
-require 'perftools'
-Axlsx.trust_input = true
+require 'ruby-prof'
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") do
+profile = RubyProf.profile do
p = Axlsx::Package.new
p.workbook.add_worksheet do |sheet|
- times.times do
+ 30.times do
sheet << row
end
end
- p.serialize("example.xlsx")
end
+printer = RubyProf::CallTreePrinter.new(profile)
+printer.print(File.new('axlsx.qcachegrind', 'w'))