Merge pull request #5665 from dearblue/benchmark1

Update benchmark task
This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-03-23 10:19:46 +09:00
committed by GitHub
2 changed files with 16 additions and 6 deletions
+9
View File
@@ -123,6 +123,7 @@ module MRuby
@enable_test = false
@enable_lock = true
@enable_presym = true
@enable_benchmark = true
@mrbcfile_external = false
@internal = internal
@toolchains = []
@@ -232,6 +233,14 @@ module MRuby
@cxx_abi_enabled = true
end
def benchmark_enabled?
@enable_benchmark
end
def disable_benchmark
@enable_benchmark = false
end
def compile_as_cxx(src, cxx_src = nil, obj = nil, includes = [])
#
# If `cxx_src` is specified, this method behaves the same as before as
+7 -6
View File
@@ -9,11 +9,8 @@ def bm_files
end
def build_config_name
if !ENV['MRUBY_CONFIG'].to_s.empty?
File.basename(ENV['MRUBY_CONFIG'], '.rb').gsub('build_config_', '')
else
"bm"
end
path = MRuby::Build.mruby_config_path
File.basename(path, '.rb').gsub('build_config_', '')
end
def plot_file
@@ -21,6 +18,8 @@ def plot_file
end
def plot
raise "no build target to benchmark against" if $dat_files.empty?
opts_file = "#{MRUBY_ROOT}/benchmark/plot.gpl"
opts = File.read(opts_file).each_line.to_a.map(&:strip).join(';')
@@ -46,11 +45,13 @@ def plot
p.puts "e"
end
end
puts "Benchmark results output to #{plot_file}"
end
MRuby.each_target do |target|
next if target.name == 'host' || target.internal?
next if !target.benchmark_enabled? || target.internal?
mruby_bin = "#{target.build_dir}/bin/mruby"
bm_files.each do |bm_file|