Skip to content

Commit 99b10ff

Browse files
committed
* benchmark/gc: create a directory to store GC related benchmark.
* benchmark/gc/gcbench.rb: moved from tool/gcbench.rb. * benchmark/gc/hash(1|2).rb: ditto. * benchmark/gc/rdoc.rb: ditto. * benchmark/gc/null.rb: added. * common.mk: fix rule. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent ab7e459 commit 99b10ff

File tree

8 files changed

+39
-23
lines changed

8 files changed

+39
-23
lines changed

ChangeLog

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Thu Jun 20 15:14:00 2013 Koichi Sasada <ko1@atdot.net>
2+
3+
* benchmark/gc: create a directory to store GC related benchmark.
4+
5+
* benchmark/gc/gcbench.rb: moved from tool/gcbench.rb.
6+
7+
* benchmark/gc/hash(1|2).rb: ditto.
8+
9+
* benchmark/gc/rdoc.rb: ditto.
10+
11+
* benchmark/gc/null.rb: added.
12+
13+
* common.mk: fix rule.
14+
115
Thu Jun 20 14:09:54 2013 Koichi Sasada <ko1@atdot.net>
216

317
* tool/hashbench1.rb: fix paramter too. Increase temporary objects.

tool/gcbench.rb renamed to benchmark/gc/gcbench.rb

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
require 'benchmark'
33
require 'pp'
44

5-
script = ARGV.shift || raise
5+
script = File.join(__dir__, ARGV.shift)
6+
script += '.rb' unless FileTest.exist?(script)
7+
raise "#{script} not found" unless FileTest.exist?(script)
8+
9+
puts "Script: #{script}"
610

711
GC::Profiler.enable
812
tms = Benchmark.measure{|x|
@@ -14,6 +18,7 @@
1418
gc_time = GC::Profiler.total_time
1519

1620
puts
21+
puts script
1722
puts Benchmark::CAPTION
1823
puts tms
1924
puts "GC total time (sec): #{gc_time}"
File renamed without changes.
File renamed without changes.

benchmark/gc/null.rb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# null

benchmark/gc/rdoc.rb

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
require 'rdoc/rdoc'
2+
require 'tmpdir'
3+
4+
srcdir = File.expand_path('../..', __dir__)
5+
6+
Dir.mktmpdir('rdocbench-'){|d|
7+
dir = File.join(d, 'rdocbench')
8+
args = %W(--root #{srcdir} --page-dir #{srcdir}/doc --encoding=UTF-8 --no-force-update --all --ri --debug --quiet #{srcdir})
9+
args << '--op' << dir
10+
11+
r = RDoc::RDoc.new
12+
r.document args
13+
}

common.mk

+5-11
Original file line numberDiff line numberDiff line change
@@ -426,19 +426,13 @@ rdoc-coverage: PHONY main
426426

427427
RDOCBENCHOUT=/tmp/rdocbench
428428

429-
gcbench-rdoc: PHONY
430-
@echo Benchmark with Generating RDoc documentation
431-
$(Q) $(XRUBY) "$(srcdir)/tool/gcbench.rb" "$(srcdir)/tool/rdocbench.rb" --root "$(srcdir)" --page-dir "$(srcdir)/doc" --encoding=UTF-8 --no-force-update --all --ri --debug $(RDOCFLAGS) --quiet "$(srcdir)"
432-
433-
gcbench-hash1: PHONY
434-
@echo "Benchmark with hashbench1 (many temporal objects / obj count intensive)"
435-
$(Q) $(XRUBY) "$(srcdir)/tool/gcbench.rb" "$(srcdir)/tool/hashbench1.rb"
429+
GCBENCH_ITEM=null
436430

437-
gcbench-hash2: PHONY
438-
@echo "Benchmark with hashbench2 (increasing hash size / malloc intensive)"
439-
$(Q) $(XRUBY) "$(srcdir)/tool/gcbench.rb" "$(srcdir)/tool/hashbench2.rb"
431+
gcbench: PHONY
432+
$(Q) $(XRUBY) "$(srcdir)/benchmark/gc/gcbench.rb" $(GCBENCH_ITEM)
440433

441-
gcbench-hash: PHONY gcbench-hash1 gcbench-hash2
434+
gcbench-rdoc: PHONY
435+
$(Q) $(XRUBY) "$(srcdir)/benchmark/gc/gcbench.rb" rdoc
442436

443437
nodoc: PHONY
444438

tool/rdocbench.rb

-11
This file was deleted.

0 commit comments

Comments
 (0)