1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/tool/rdocbench.rb

22 lines
345 B
Ruby
Raw Normal View History

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
}
}
}