Output PNG instead of PDF
furunkel
9 years ago
3 | 3 |
*.o
|
4 | 4 |
/benchmark/**/*.dat
|
5 | 5 |
/benchmark/*.pdf
|
|
6 |
/benchmark/*.png
|
6 | 7 |
*.orig
|
7 | 8 |
*.pdb
|
8 | 9 |
*.rej
|
0 | 0 |
set yrange [0:]
|
1 | |
set terminal pdf font 'Sans, 3'
|
|
1 |
set terminal pngcairo font 'Sans, 8' lw 1 size 1400,1024
|
2 | 2 |
set xtics rotate by -45
|
3 | 3 |
set style histogram errorbars gap 2 lw 1
|
4 | 4 |
set style fill solid border -1
|
7 | 7 |
Dir.glob("#{MRUBY_ROOT}/benchmark/bm_*.rb")
|
8 | 8 |
end
|
9 | 9 |
|
10 | |
def plot_file
|
11 | |
File.join(MRUBY_ROOT, 'benchmark', 'bm.pdf')
|
12 | |
end
|
13 | |
|
14 | 10 |
def build_config_name
|
15 | 11 |
if ENV['MRUBY_CONFIG']
|
16 | 12 |
File.basename(ENV['MRUBY_CONFIG'], '.rb').gsub('build_config_', '')
|
|
19 | 15 |
end
|
20 | 16 |
end
|
21 | 17 |
|
|
18 |
def plot_file
|
|
19 |
File.join(MRUBY_ROOT, 'benchmark', "#{build_config_name}.png")
|
|
20 |
end
|
|
21 |
|
22 | 22 |
def plot
|
23 | 23 |
opts_file = "#{MRUBY_ROOT}/benchmark/plot.gpl"
|
24 | 24 |
opts = File.read(opts_file).each_line.to_a.map(&:strip).join(';')
|
25 | 25 |
|
26 | 26 |
dat_files = $dat_files.group_by {|f| File.dirname(f).split(File::SEPARATOR)[-1]}
|
27 | 27 |
|
28 | |
opts += ";set output '#{File.join(MRUBY_ROOT, 'benchmark', "#{build_config_name}.pdf")}'"
|
|
28 |
opts += ";set output '#{plot_file}'"
|
29 | 29 |
|
30 | 30 |
opts += ';plot '
|
31 | 31 |
|
|
36 | 36 |
|
37 | 37 |
cmd = %Q{gnuplot -p -e "#{opts}"}
|
38 | 38 |
|
39 | |
p cmd
|
40 | 39 |
IO.popen(cmd, 'w') do |p|
|
41 | 40 |
dat_files.each do |target_name, bm_files|
|
42 | 41 |
p.puts target_name.gsub('_', '-')
|