summaryrefslogtreecommitdiff
path: root/tool/rdocbench.rb
diff options
context:
space:
mode:
Diffstat (limited to 'tool/rdocbench.rb')
-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
+ }
+ }
+}