Skip to content

Commit

Permalink
fixes to get stats running again
Browse files Browse the repository at this point in the history
  • Loading branch information
jredville committed Jun 25, 2009
1 parent e8b2179 commit c1cfe7b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion retry.bat
@@ -1,4 +1,4 @@
pushd %~dp0\..\..\..\Main
pushd %MERLIN_ROOT%
tf get
popd
pushd %~dp0
Expand Down
52 changes: 27 additions & 25 deletions stats.rb
Expand Up @@ -4,10 +4,10 @@
BIN = "#{REPO}/Merlin/Main/Bin/debug"
CD = File.expand_path(File.dirname(__FILE__))
DATA = "#{CD}/data"
INTERPRET = "-X:Interpret"
NAC = "-X:NoAdaptiveCompilation"
IR = "#{BIN}/ir.exe"
MSPEC = "mspec.bat run -fs"
MSPEC_OPTIONS = "-Gcritical -Gthread"
MSPEC_OPTIONS = "-Gcritical -Gunstable"

require 'fileutils'
require 'mymath'
Expand Down Expand Up @@ -113,10 +113,10 @@ def startup_time
iters = 10.0
iters.to_i.times do
c += Benchmark.measure do
`#{IR} #{CD}/empty.rb`
`#{IR} #{NAC} #{CD}/empty.rb`
end.real
i += Benchmark.measure do
`#{IR} #{INTERPRET} #{CD}/empty.rb`
`#{IR} #{CD}/empty.rb`
end.real
r += Benchmark.measure do
`ruby #{CD}/empty.rb`
Expand All @@ -133,8 +133,8 @@ def throughput
c = i = r = 0
iters = 10.0
iters.to_i.times do
i += `#{IR} #{INTERPRET} #{CD}/loop.rb`.to_f
c += `#{IR} #{CD}/loop.rb`.to_f
i += `#{IR} #{CD}/loop.rb`.to_f
c += `#{IR} #{NAC} #{CD}/loop.rb`.to_f
r += `ruby #{CD}/loop.rb`.to_f
end
c, i, r = [c,i,r].map{|i| i / iters}
Expand Down Expand Up @@ -432,26 +432,28 @@ def usage
o
end

if ARGV.empty?
puts usage
end
if __FILE__ == $0
if ARGV.empty?
puts usage
end

ARGV.each do |arg|
found = false

$behavior.each do |options, lmbd|
if options.include?(arg)
found = true
lmbd.call
elsif options.select{|o| o.kind_of?(Regexp) && arg =~ o}.size == 1
found = true
lmbd.call($~)
ARGV.each do |arg|
found = false

$behavior.each do |options, lmbd|
if options.include?(arg)
found = true
lmbd.call
elsif options.select{|o| o.kind_of?(Regexp) && arg =~ o}.size == 1
found = true
lmbd.call($~)
end
end

unless found
puts "Unknown argument '#{arg}'"
puts usage
exit
end
end

unless found
puts "Unknown argument '#{arg}'"
puts usage
exit
end
end

0 comments on commit c1cfe7b

Please sign in to comment.