Codebase list mruby / 6110b38
Output PNG instead of PDF furunkel 9 years ago
3 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
33 *.o
44 /benchmark/**/*.dat
55 /benchmark/*.pdf
6 /benchmark/*.png
67 *.orig
78 *.pdb
89 *.rej
00 set yrange [0:]
1 set terminal pdf font 'Sans, 3'
1 set terminal pngcairo font 'Sans, 8' lw 1 size 1400,1024
22 set xtics rotate by -45
33 set style histogram errorbars gap 2 lw 1
44 set style fill solid border -1
77 Dir.glob("#{MRUBY_ROOT}/benchmark/bm_*.rb")
88 end
99
10 def plot_file
11 File.join(MRUBY_ROOT, 'benchmark', 'bm.pdf')
12 end
13
1410 def build_config_name
1511 if ENV['MRUBY_CONFIG']
1612 File.basename(ENV['MRUBY_CONFIG'], '.rb').gsub('build_config_', '')
1915 end
2016 end
2117
18 def plot_file
19 File.join(MRUBY_ROOT, 'benchmark', "#{build_config_name}.png")
20 end
21
2222 def plot
2323 opts_file = "#{MRUBY_ROOT}/benchmark/plot.gpl"
2424 opts = File.read(opts_file).each_line.to_a.map(&:strip).join(';')
2525
2626 dat_files = $dat_files.group_by {|f| File.dirname(f).split(File::SEPARATOR)[-1]}
2727
28 opts += ";set output '#{File.join(MRUBY_ROOT, 'benchmark', "#{build_config_name}.pdf")}'"
28 opts += ";set output '#{plot_file}'"
2929
3030 opts += ';plot '
3131
3636
3737 cmd = %Q{gnuplot -p -e "#{opts}"}
3838
39 p cmd
4039 IO.popen(cmd, 'w') do |p|
4140 dat_files.each do |target_name, bm_files|
4241 p.puts target_name.gsub('_', '-')