mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
ab7e459210
commit
99b10ff471
8 changed files with 40 additions and 24 deletions
14
ChangeLog
14
ChangeLog
|
@ -1,3 +1,17 @@
|
|||
Thu Jun 20 15:14:00 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* 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.
|
||||
|
||||
Thu Jun 20 14:09:54 2013 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* tool/hashbench1.rb: fix paramter too. Increase temporary objects.
|
||||
|
|
|
@ -2,7 +2,11 @@
|
|||
require 'benchmark'
|
||||
require 'pp'
|
||||
|
||||
script = ARGV.shift || raise
|
||||
script = File.join(__dir__, ARGV.shift)
|
||||
script += '.rb' unless FileTest.exist?(script)
|
||||
raise "#{script} not found" unless FileTest.exist?(script)
|
||||
|
||||
puts "Script: #{script}"
|
||||
|
||||
GC::Profiler.enable
|
||||
tms = Benchmark.measure{|x|
|
||||
|
@ -14,6 +18,7 @@ pp GC.stat
|
|||
gc_time = GC::Profiler.total_time
|
||||
|
||||
puts
|
||||
puts script
|
||||
puts Benchmark::CAPTION
|
||||
puts tms
|
||||
puts "GC total time (sec): #{gc_time}"
|
1
benchmark/gc/null.rb
Normal file
1
benchmark/gc/null.rb
Normal file
|
@ -0,0 +1 @@
|
|||
# null
|
13
benchmark/gc/rdoc.rb
Normal file
13
benchmark/gc/rdoc.rb
Normal file
|
@ -0,0 +1,13 @@
|
|||
require 'rdoc/rdoc'
|
||||
require 'tmpdir'
|
||||
|
||||
srcdir = File.expand_path('../..', __dir__)
|
||||
|
||||
Dir.mktmpdir('rdocbench-'){|d|
|
||||
dir = File.join(d, 'rdocbench')
|
||||
args = %W(--root #{srcdir} --page-dir #{srcdir}/doc --encoding=UTF-8 --no-force-update --all --ri --debug --quiet #{srcdir})
|
||||
args << '--op' << dir
|
||||
|
||||
r = RDoc::RDoc.new
|
||||
r.document args
|
||||
}
|
18
common.mk
18
common.mk
|
@ -426,19 +426,13 @@ rdoc-coverage: PHONY main
|
|||
|
||||
RDOCBENCHOUT=/tmp/rdocbench
|
||||
|
||||
GCBENCH_ITEM=null
|
||||
|
||||
gcbench: PHONY
|
||||
$(Q) $(XRUBY) "$(srcdir)/benchmark/gc/gcbench.rb" $(GCBENCH_ITEM)
|
||||
|
||||
gcbench-rdoc: PHONY
|
||||
@echo Benchmark with Generating RDoc documentation
|
||||
$(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)"
|
||||
|
||||
gcbench-hash1: PHONY
|
||||
@echo "Benchmark with hashbench1 (many temporal objects / obj count intensive)"
|
||||
$(Q) $(XRUBY) "$(srcdir)/tool/gcbench.rb" "$(srcdir)/tool/hashbench1.rb"
|
||||
|
||||
gcbench-hash2: PHONY
|
||||
@echo "Benchmark with hashbench2 (increasing hash size / malloc intensive)"
|
||||
$(Q) $(XRUBY) "$(srcdir)/tool/gcbench.rb" "$(srcdir)/tool/hashbench2.rb"
|
||||
|
||||
gcbench-hash: PHONY gcbench-hash1 gcbench-hash2
|
||||
$(Q) $(XRUBY) "$(srcdir)/benchmark/gc/gcbench.rb" rdoc
|
||||
|
||||
nodoc: PHONY
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
require 'rdoc/rdoc'
|
||||
require 'tmpdir'
|
||||
|
||||
Dir.mktmpdir('rdocbench-'){|d|
|
||||
dir = File.join(d, 'rdocbench')
|
||||
args = ARGV.dup
|
||||
args << '--op' << dir
|
||||
|
||||
r = RDoc::RDoc.new
|
||||
r.document args
|
||||
}
|
Loading…
Reference in a new issue