summaryrefslogtreecommitdiff
path: root/tool/rdocbench.rb
blob: db5e0bebf267a08552b8906b7b9fb0a25b073515 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
    }
  }
}