Unverified Commit ef9c6879 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto Committed by GitHub

Merge pull request #5058 from dearblue/benchmark

Improve `rake benchmark`
parents cfb799a1 fde95a7d
...@@ -5,7 +5,7 @@ end ...@@ -5,7 +5,7 @@ end
$dat_files = [] $dat_files = []
def bm_files def bm_files
Dir.glob("#{MRUBY_ROOT}/benchmark/bm_*.rb") Dir.glob("#{MRUBY_ROOT}/benchmark/bm_*.rb").sort
end end
def build_config_name def build_config_name
...@@ -67,8 +67,8 @@ MRuby.each_target do |target| ...@@ -67,8 +67,8 @@ MRuby.each_target do |target|
puts "..." puts "..."
data = (0...MRuby::BENCHMARK_REPEAT).map do |n| data = (0...MRuby::BENCHMARK_REPEAT).map do |n|
str = %x{(time -f "%e %S %U" #{mruby_bin} #{bm_file}) 2>&1 >/dev/null} str = %x{(time -p #{mruby_bin} #{bm_file}) 2>&1 >/dev/null}
str.split(' ').map(&:to_f) str.scan(/\d+\.\d+$/).map(&:to_f) # [real, user, sys]
end end
File.open(task.name, "w") do |f| File.open(task.name, "w") do |f|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment