blob: f325f6a187de895ad8a6ebf9157a17098cc0f761 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
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
tms = Benchmark.measure{|x|
r = RDoc::RDoc.new
r.document args
}
GC::Profiler.report
pp GC.stat
puts
puts Benchmark::CAPTION
puts tms
puts "GC total time (sec): #{GC::Profiler.total_time}"
puts
puts "Summary (ruby): #{RUBY_DESCRIPTION})"
puts "Summary (real): #{tms.real} sec"
puts "Summary (gctm): #{GC::Profiler.total_time} sec"
puts "Summary (gc#) : #{GC.count}"
}
|