From 4ef881bd15c9c4e2e9b20da2c091e80d4d530119 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 31 Dec 2006 15:02:22 +0000 Subject: * Merge YARV git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@11439 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- benchmark/runc.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 benchmark/runc.rb (limited to 'benchmark/runc.rb') diff --git a/benchmark/runc.rb b/benchmark/runc.rb new file mode 100644 index 000000000..20e06b235 --- /dev/null +++ b/benchmark/runc.rb @@ -0,0 +1,29 @@ +# +# +# + +require 'benchmark' +require 'rbconfig' + +$rubybin = ENV['RUBY'] || File.join( + Config::CONFIG["bindir"], + Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]) + +def runfile file + puts file + file = File.join(File.dirname($0), 'contrib', file) + Benchmark.bm{|x| + x.report('ruby'){ + system("#{$rubybin} #{file}") + } + x.report('yarv'){ + system("#{$rubybin} -rite -I.. #{file}") + } + } +end + +ARGV.each{|file| + runfile file +} + + -- cgit