Commit 6110b385 authored by furunkel's avatar furunkel

Output PNG instead of PDF

parent 105f1f38
No related merge requests found
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*.o *.o
/benchmark/**/*.dat /benchmark/**/*.dat
/benchmark/*.pdf /benchmark/*.pdf
/benchmark/*.png
*.orig *.orig
*.pdb *.pdb
*.rej *.rej
......
set yrange [0:] set yrange [0:]
set terminal pdf font 'Sans, 3' set terminal pngcairo font 'Sans, 8' lw 1 size 1400,1024
set xtics rotate by -45 set xtics rotate by -45
set style histogram errorbars gap 2 lw 1 set style histogram errorbars gap 2 lw 1
set style fill solid border -1 set style fill solid border -1
...@@ -8,10 +8,6 @@ def bm_files ...@@ -8,10 +8,6 @@ def bm_files
Dir.glob("#{MRUBY_ROOT}/benchmark/bm_*.rb") Dir.glob("#{MRUBY_ROOT}/benchmark/bm_*.rb")
end end
def plot_file
File.join(MRUBY_ROOT, 'benchmark', 'bm.pdf')
end
def build_config_name def build_config_name
if ENV['MRUBY_CONFIG'] if ENV['MRUBY_CONFIG']
File.basename(ENV['MRUBY_CONFIG'], '.rb').gsub('build_config_', '') File.basename(ENV['MRUBY_CONFIG'], '.rb').gsub('build_config_', '')
...@@ -20,13 +16,17 @@ def build_config_name ...@@ -20,13 +16,17 @@ def build_config_name
end end
end end
def plot_file
File.join(MRUBY_ROOT, 'benchmark', "#{build_config_name}.png")
end
def plot def plot
opts_file = "#{MRUBY_ROOT}/benchmark/plot.gpl" opts_file = "#{MRUBY_ROOT}/benchmark/plot.gpl"
opts = File.read(opts_file).each_line.to_a.map(&:strip).join(';') opts = File.read(opts_file).each_line.to_a.map(&:strip).join(';')
dat_files = $dat_files.group_by {|f| File.dirname(f).split(File::SEPARATOR)[-1]} dat_files = $dat_files.group_by {|f| File.dirname(f).split(File::SEPARATOR)[-1]}
opts += ";set output '#{File.join(MRUBY_ROOT, 'benchmark', "#{build_config_name}.pdf")}'" opts += ";set output '#{plot_file}'"
opts += ';plot ' opts += ';plot '
...@@ -37,7 +37,6 @@ def plot ...@@ -37,7 +37,6 @@ def plot
cmd = %Q{gnuplot -p -e "#{opts}"} cmd = %Q{gnuplot -p -e "#{opts}"}
p cmd
IO.popen(cmd, 'w') do |p| IO.popen(cmd, 'w') do |p|
dat_files.each do |target_name, bm_files| dat_files.each do |target_name, bm_files|
p.puts target_name.gsub('_', '-') p.puts target_name.gsub('_', '-')
......
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