2 # YARV benchmark driver
9 def exec_command type, file, w
11 $DRIVER_PATH = '#{File.dirname($0)}'
12 $LOAD_PATH.replace $LOAD_PATH | #{$LOAD_PATH.inspect}
17 puts Benchmark.measure{
20 rescue Exception => exec_command_error_variable
21 puts "\t" + exec_command_error_variable.message
27 rubybin = ENV['RUBY'] || File.join(
28 Config::CONFIG["bindir"],
29 Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"])
31 IO.popen(rubybin, 'r+'){|io|
39 prog = exec_command 'ruby', file, 'load'
44 prog = exec_command 'yarv', file, 'YARVUtil.load_bm'
51 file = File.dirname($0) + "/bm_#{bench}.rb"
52 r = ruby_exec(file).to_f
53 y = yarv_exec(file).to_f
54 puts "#{bench}\t#{r}\t#{y}"