ruby-changes:28820
From: ko1 <ko1@a...>
Date: Tue, 21 May 2013 16:36:44 +0900 (JST)
Subject: [ruby-changes:28820] ko1:r40872 (trunk): * common.mk (rdoc-bench): add a benchmark rule
ko1 2013-05-21 16:36:34 +0900 (Tue, 21 May 2013) New Revision: 40872 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40872 Log: * common.mk (rdoc-bench): add a benchmark rule using RDoc. Generate all rdoc related files (same as `make rdoc') in temporary directory and remove them. Excecution time, GC::Profiler and results of GC.stat are printed. * tool/rdocbench.rb: added for `rdoc-bench'. Added files: trunk/tool/rdocbench.rb Modified files: trunk/ChangeLog trunk/common.mk Index: ChangeLog =================================================================== --- ChangeLog (revision 40871) +++ ChangeLog (revision 40872) @@ -1,3 +1,13 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Tue May 21 16:29:09 2013 Koichi Sasada <ko1@a...> + + * common.mk (rdoc-bench): add a benchmark rule + using RDoc. Generate all rdoc related files + (same as `make rdoc') in temporary directory + and remove them. Excecution time, GC::Profiler + and results of GC.stat are printed. + + * tool/rdocbench.rb: added for `rdoc-bench'. + Tue May 21 16:25:05 2013 Koichi Sasada <ko1@a...> * gc.c (gc_profile_dump_on): `count' should be (int) because it Index: common.mk =================================================================== --- common.mk (revision 40871) +++ common.mk (revision 40872) @@ -424,6 +424,12 @@ rdoc-coverage: PHONY main https://github.com/ruby/ruby/blob/trunk/common.mk#L424 @echo Generating RDoc coverage report $(Q) $(XRUBY) "$(srcdir)/bin/rdoc" --root "$(srcdir)" --encoding=UTF-8 --all --quiet -C $(RDOCFLAGS) "$(srcdir)" +RDOCBENCHOUT=/tmp/rdocbench + +rdoc-bench: PHONY ruby + @echo Benchmark with Generating RDoc documentation + $(Q) $(XRUBY) "$(srcdir)/tool/rdocbench.rb" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --ri --debug $(RDOCFLAGS) --quiet "$(srcdir)" + nodoc: PHONY what-where-doc: no-install-doc Index: tool/rdocbench.rb =================================================================== --- tool/rdocbench.rb (revision 0) +++ tool/rdocbench.rb (revision 40872) @@ -0,0 +1,21 @@ https://github.com/ruby/ruby/blob/trunk/tool/rdocbench.rb#L1 + +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 + } + } +} -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/