blob: 946d646431c2640d980a07e7e6568ae0bcb5796c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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
puts "GC Total Time:#{GC::Profiler.total_time}"
}
}
}
|