mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
d22d3b5a7a
commit
384cfd3871
4 changed files with 34 additions and 34 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Jan 6 03:49:22 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* benchmark/run.rb : change option format
|
||||
|
||||
* common.mk : ditto
|
||||
|
||||
Fri Jan 5 22:21:08 2007 Koichi Sasada <ko1@atdot.net>
|
||||
|
||||
* benchmark/bm_app_pentomino.rb : use Array#dup instead of
|
||||
|
|
|
@ -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 <<EOS unless $yarvonly || $rubyonly
|
||||
puts <<EOS unless $matzrubyonly || $rubyonly
|
||||
#{prog}
|
||||
--
|
||||
EOS
|
||||
#iseq = YARVUtil.parse(File.read(file))
|
||||
#vm = YARVCore::VM.new
|
||||
begin
|
||||
result = [bm_name]
|
||||
result << ruby_exec(file) unless $yarvonly
|
||||
result << yarv_exec(file) unless $rubyonly
|
||||
result << matzruby_exec(file) unless $rubyonly
|
||||
result << ruby_exec(file) unless $matzrubyonly
|
||||
$results << result
|
||||
|
||||
# puts YARVUtil.parse(File.read(file), file, 1).disasm
|
||||
|
||||
# x.report("ruby"){ load(file, false) }
|
||||
# x.report("yarv"){ vm.eval iseq }
|
||||
|
||||
rescue Exception => 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|
|
||||
|
|
14
common.mk
14
common.mk
|
@ -525,7 +525,7 @@ blockinlining.$(OBJEXT): {$(VPATH)}yarv.h {$(VPATH)}yarvcore.h vm_opts.h
|
|||
|
||||
|
||||
BASERUBY = ruby
|
||||
MATZRUBY = ruby
|
||||
MATZRUBY = $(BASERUBY)
|
||||
|
||||
INSNS2VMOPT = $(CPPFLAGS) --srcdir=$(srcdir)
|
||||
|
||||
|
@ -580,13 +580,13 @@ parse: miniruby$(EXEEXT)
|
|||
$(MINIRUBY) $(srcdir)/tool/parse.rb $(srcdir)/test.rb
|
||||
|
||||
benchmark: $(RUBY)
|
||||
$(BASERUBY) -I$(srcdir) -I$(srcdir)/lib $(srcdir)/benchmark/run.rb $(OPT) $(ITEMS) --yarv-program=./$(PROGRAM) --ruby-program=$(BASERUBY) --opts=-I$(srcdir)/lib
|
||||
$(BASERUBY) -I$(srcdir)/lib $(srcdir)/benchmark/run.rb $(OPT) $(ITEMS) --ruby=./$(RUBY) --matzruby=$(MATZRUBY) --opts=-I$(srcdir)/lib
|
||||
|
||||
benchmark-each: $(RUBY)
|
||||
$(BASERUBY) -I$(srcdir) $(srcdir)/benchmark/run.rb bm_$(ITEM) $(OPT) --yarv-program=./$(RUBY) --ruby-program=$(BASERUBY) --opts=-I$(srcdir)/lib
|
||||
$(BASERUBY) -I$(srcdir)/lib $(srcdir)/benchmark/run.rb bm_$(ITEM) $(OPT) --ruby=./$(RUBY) --matzruby=$(MATZRUBY) --opts=-I$(srcdir)/lib
|
||||
|
||||
tbench: $(RUBY)
|
||||
$(BASERUBY) -I$(srcdir) -I$(srcdir)/lib $(srcdir)/benchmark/run.rb bmx $(OPT) --yarv-program=./$(PROGRAM) --ruby-program=$(BASERUBY) --opts=-I$(srcdir)/lib
|
||||
$(BASERUBY) -I$(srcdir)/lib $(srcdir)/benchmark/run.rb bmx $(OPT) --ruby=./$(RUBY) --matzruby=$(MATZRUBY) --opts=-I$(srcdir)/lib
|
||||
|
||||
aotc:
|
||||
$(RUBY) -I$(srcdir) -I. $(srcdir)/tool/aotcompile.rb $(INSNS2VMOPT)
|
||||
|
@ -599,9 +599,9 @@ vmasm:
|
|||
|
||||
run.gdb:
|
||||
echo b debug_breakpoint > run.gdb
|
||||
echo handle SIGINT nostop
|
||||
echo handle SIGPIPE nostop
|
||||
echo run >> run.gdb
|
||||
# echo handle SIGINT nostop >> run.gdb
|
||||
# echo handle SIGPIPE nostop >> run.gdb
|
||||
echo run >> run.gdb
|
||||
|
||||
gdb: miniruby$(EXEEXT) run.gdb
|
||||
gdb -x run.gdb --quiet --args $(MINIRUBY) -I$(srcdir)/lib $(srcdir)/test.rb
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#define RUBY_VERSION "1.9.0"
|
||||
#define RUBY_RELEASE_DATE "2007-01-05"
|
||||
#define RUBY_RELEASE_DATE "2007-01-06"
|
||||
#define RUBY_VERSION_CODE 190
|
||||
#define RUBY_RELEASE_CODE 20070105
|
||||
#define RUBY_RELEASE_CODE 20070106
|
||||
#define RUBY_PATCHLEVEL 0
|
||||
|
||||
#define RUBY_VERSION_MAJOR 1
|
||||
|
@ -9,7 +9,7 @@
|
|||
#define RUBY_VERSION_TEENY 0
|
||||
#define RUBY_RELEASE_YEAR 2007
|
||||
#define RUBY_RELEASE_MONTH 1
|
||||
#define RUBY_RELEASE_DAY 5
|
||||
#define RUBY_RELEASE_DAY 6
|
||||
|
||||
RUBY_EXTERN const char ruby_version[];
|
||||
RUBY_EXTERN const char ruby_release_date[];
|
||||
|
|
Loading…
Reference in a new issue