From 384cfd3871c1839d0f167f9f4bf39ef3dcd42069 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 5 Jan 2007 18:54:33 +0000 Subject: * benchmark/run.rb : change option format * common.mk : ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11486 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/run.rb | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'benchmark/run.rb') diff --git a/benchmark/run.rb b/benchmark/run.rb index 7a8d268b24..e121db497b 100644 --- a/benchmark/run.rb +++ b/benchmark/run.rb @@ -1,11 +1,11 @@ # -# YARV benchmark driver +# Ruby benchmark driver # require 'benchmark' require 'rbconfig' -$yarvonly = false +$matzrubyonly = false $rubyonly = false $results = [] @@ -31,26 +31,20 @@ def bm file /[a-z]+_(.+)\.rb/ =~ file bm_name = $1 - puts '-----------------------------------------------------------' unless $yarvonly || $rubyonly + puts '-----------------------------------------------------------' unless $rubyonly || $matzrubyonly puts "#{bm_name}: " -puts < e puts puts "** benchmark failure: #{e}" @@ -72,35 +66,35 @@ def ruby_exec file benchmark file, $ruby_program end -def yarv_exec file - print 'yarv' - benchmark file, $yarv_program +def matzruby_exec file + print 'matz' + benchmark file, $matzruby_program end if $0 == __FILE__ ARGV.each{|arg| case arg - when /\A--yarv-program=(.+)/ - $yarv_program = $1 - when /\A--ruby-program=(.+)/ + when /\A--ruby=(.+)/ $ruby_program = $1 + when /\A--matzruby=(.+)/ + $matzruby_program = $1 when /\A--opts=(.+)/ $opts = $1 - when /\A(--yarv)|(-y)/ - $yarvonly = true - when /\A(--ruby)|(-r)/ + when /\A(-r|--only-ruby)\z/ $rubyonly = true + when /\A(-m|--only-matzruby)\z/ + $matzrubyonly = true end } ARGV.delete_if{|arg| /\A-/ =~ arg } + puts "MatzRuby:" + system("#{$matzruby_program} -v") puts "Ruby:" system("#{$ruby_program} -v") puts - puts "YARV:" - system("#{$yarv_program} -v") if ARGV.empty? Dir.glob(File.dirname(__FILE__) + '/bm_*.rb').sort.each{|file| -- cgit v1.2.3