summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-21 07:36:34 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-21 07:36:34 +0000
commit6f7c9e2ecb20d138565f17286620fc656dd5ffbd (patch)
tree2cb8c56f9e37e96101ff15e66e5f8a936a26a8cb /tool
parentf3cdb9f3fbd9ae6965b921314b5becedb6517994 (diff)
* common.mk (rdoc-bench): add a benchmark rule
using RDoc. Generate all rdoc related files (same as `make rdoc') in temporary directory and remove them. Excecution time, GC::Profiler and results of GC.stat are printed. * tool/rdocbench.rb: added for `rdoc-bench'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/rdocbench.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/tool/rdocbench.rb b/tool/rdocbench.rb
new file mode 100644
index 0000000000..db5e0bebf2
--- /dev/null
+++ b/tool/rdocbench.rb
@@ -0,0 +1,21 @@
+
+require 'rdoc/rdoc'
+require 'tmpdir'
+require 'benchmark'
+require 'pp'
+
+Dir.mktmpdir('rdocbench-'){|d|
+ dir = File.join(d, 'rdocbench')
+ args = ARGV.dup
+ args << '--op' << dir
+
+ GC::Profiler.enable
+ Benchmark.bm{|x|
+ x.report('rdoc'){
+ r = RDoc::RDoc.new
+ r.document args
+ GC::Profiler.report
+ pp GC.stat
+ }
+ }
+}