@@ -31,26 +31,26 @@ def self.render(json_path, png_path, title_font_size: 16.0, legend_font_size: 12
3131 bench_names = data . first . last . keys
3232
3333 # ruby_descriptions, bench_names, table
34- g = Gruff ::Bar . new ( DEFAULT_WIDTH )
35- g . title = "Speedup ratio relative to #{ ruby_descriptions . keys . first } "
36- g . title_font_size = title_font_size
37- g . theme = THEME
38- g . labels = bench_names . map . with_index { |bench , index | [ index , bench ] } . to_h
39- g . show_labels_for_bar_values = true
40- g . bottom_margin = DEFAULT_BOTTOM_MARGIN
41- g . legend_margin = DEFAULT_LEGEND_MARGIN
42- g . legend_font_size = legend_font_size
43- g . marker_font_size = marker_font_size
34+ graph = Gruff ::Bar . new ( DEFAULT_WIDTH )
35+ graph . title = "Speedup ratio relative to #{ ruby_descriptions . keys . first } "
36+ graph . title_font_size = title_font_size
37+ graph . theme = THEME
38+ graph . labels = bench_names . map . with_index { |bench , index | [ index , bench ] } . to_h
39+ graph . show_labels_for_bar_values = true
40+ graph . bottom_margin = DEFAULT_BOTTOM_MARGIN
41+ graph . legend_margin = DEFAULT_LEGEND_MARGIN
42+ graph . legend_font_size = legend_font_size
43+ graph . marker_font_size = marker_font_size
4444
4545 ruby_descriptions . each do |ruby , description |
4646 speedups = bench_names . map { |bench |
4747 baseline_times = data . fetch ( baseline ) . fetch ( bench ) . fetch ( "bench" )
4848 times = data . fetch ( ruby ) . fetch ( bench ) . fetch ( "bench" )
4949 Stats . new ( baseline_times ) . mean / Stats . new ( times ) . mean
5050 }
51- g . data "#{ ruby } : #{ description } " , speedups
51+ graph . data "#{ ruby } : #{ description } " , speedups
5252 end
53- g . write ( png_path )
53+ graph . write ( png_path )
5454 png_path
5555 end
5656end
0 commit comments