summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rw-r--r--common.mk6
-rw-r--r--tool/rdocbench.rb21
3 files changed, 37 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 024f48c4f9..fe755604ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue May 21 16:29:09 2013 Koichi Sasada <ko1@atdot.net>
+
+ * 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@atdot.net>
* gc.c (gc_profile_dump_on): `count' should be (int) because it
diff --git a/common.mk b/common.mk
index 76f4c9a2a6..66d18216b3 100644
--- a/common.mk
+++ b/common.mk
@@ -424,6 +424,12 @@ rdoc-coverage: PHONY main
@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
diff --git a/tool/rdocbench.rb b/tool/rdocbench.rb
new file mode 100644
index 0000000000..db5e0bebf2
--- /dev/null
+++ b/tool/rdocbench.rb
@@ -0,0 +1,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
+ }
+ }
+}