Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified results/intermittent/normalized_time_box.pdf
Binary file not shown.
Binary file modified results/plots/execution_time_10uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/execution_time_50uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/execution_time_5uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/runtime_region_boundary_calls_10uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/runtime_region_boundary_calls_50uF_normalized.pdf
Binary file not shown.
Binary file modified results/plots/runtime_region_boundary_calls_5uF_normalized.pdf
Binary file not shown.
16 changes: 13 additions & 3 deletions scripts/plot_common.R
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,30 @@ PATTERN_LEGEND_SPACING <- 0.055
PATTERN_LEGEND_ALPHA <- 1.0
PATTERN_LEGEND_SIZE <- 0.42

# Compact paper figure dimensions. Preserve readable text and reclaim vertical
# space from the legend before shrinking the data panel.
PLOT_HEIGHT_IN <- 2.6
LEGEND_KEY_HEIGHT_CM <- 0.55
AXIS_TITLE_SIZE <- 13
AXIS_SUBTITLE_SIZE <- 9.5

# -- Axis title ---------------------------------------------------------------

# Y-axis title with a smaller second line. Plotmath's atop() pads the two
# lines far more than the text needs, so the title grob is built directly and
# swapped into the rendered gtable.
stack_ylab <- function(p, main, sub) {
main_g <- textGrob(main, rot = 90,
gp = gpar(fontsize = 15.5, fontfamily = "Helvetica"))
gp = gpar(fontsize = AXIS_TITLE_SIZE,
fontfamily = "Helvetica"))
sub_g <- textGrob(sub, rot = 90,
gp = gpar(fontsize = 11, fontfamily = "Helvetica"))
gp = gpar(fontsize = AXIS_SUBTITLE_SIZE,
fontfamily = "Helvetica"))
# Column widths are line heights rather than grobWidth(), which ignores
# descenders.
title <- gtable(
widths = unit(c(15.5 * 1.2, 11 * 1.2, 7), "pt"),
widths = unit(c(AXIS_TITLE_SIZE * 1.2,
AXIS_SUBTITLE_SIZE * 1.2, 7), "pt"),
heights = unit(1, "null")
)
title <- gtable_add_grob(title, list(main_g, sub_g), t = 1, l = c(1, 2))
Expand Down
11 changes: 7 additions & 4 deletions scripts/plot_intermittent.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,16 @@ theme_benchmark <- function() {
theme_minimal(base_size = 15, base_family = "Helvetica") +
theme(
axis.title.x = element_blank(),
axis.title.y = element_text(size = 15.5, margin = margin(r = 7)),
axis.title.y = element_text(size = AXIS_TITLE_SIZE,
margin = margin(r = 7)),
axis.text.x = element_text(size = 11),
axis.text.y = element_text(size = 12.5),
legend.position = "top",
legend.title = element_blank(),
legend.text = element_text(size = 13),
legend.key.size = unit(0.68, "cm"),
legend.key.height = unit(LEGEND_KEY_HEIGHT_CM, "cm"),
legend.key.width = unit(0.68, "cm"),
legend.box.spacing = unit(0.01, "cm"),
legend.margin = margin(0, 0, 0, 0),
panel.grid.major.x = element_blank(),
panel.grid.minor = element_blank(),
Expand Down Expand Up @@ -132,5 +135,5 @@ p_box <- ggplot(box_data, aes(benchmark, normalized, fill = algo)) +
y_scale +
theme_benchmark()
ggsave(file.path(output_dir, "normalized_time_box.pdf"),
stack_ylab(p_box, "Relative Execution Time", paste0("(to ", REF_LABEL, ")")),
width = 12.5, height = 3.95)
stack_ylab(p_box, "Relative Time", paste0("(to ", REF_LABEL, ")")),
width = 12.5, height = PLOT_HEIGHT_IN)
33 changes: 19 additions & 14 deletions scripts/plot_results.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,36 +51,36 @@ METRICS <- list(
region_boundaries = list(
source = "debug", column = "region_boundaries",
include_baselines = FALSE,
ylabel = "# Region Boundaries (static)",
relative_ylabel = "Relative Region Boundaries",
ylabel = "# Static Boundaries",
relative_ylabel = "Relative Boundaries",
title = "Region Boundaries"
),
runtime_region_boundary_calls = list(
source = "debug", column = "runtime_region_boundary_calls",
include_baselines = FALSE,
ylabel = "# Runtime Region Boundary Calls",
relative_ylabel = "Relative Region Boundary Hits",
ylabel = "# Boundary Calls",
relative_ylabel = "Relative Hits",
title = "Region Boundary Calls at Run-time"
),
execution_time = list(
source = "no-debug", column = "execution_time_us",
include_baselines = TRUE,
ylabel = expression("Execution Time (" * mu * "s)"),
relative_ylabel = "Relative Execution Time",
relative_ylabel = "Relative Time",
title = "Execution Time"
),
profiling_time = list(
source = "no-debug", column = "profiling_time_ms",
include_baselines = FALSE,
ylabel = "Profiling Time (ms)",
relative_ylabel = "Relative Profiling Time",
relative_ylabel = "Relative Profile Time",
title = "Profiling Time"
),
compilation_time = list(
source = "no-debug", column = "compilation_time_ms",
include_baselines = TRUE,
ylabel = "Compilation Time (ms)",
relative_ylabel = "Relative Compilation Time",
relative_ylabel = "Compilation Ratio",
title = "Compilation Time"
)
)
Expand All @@ -97,14 +97,17 @@ theme_benchmark <- function() {
plot.title = element_blank(),
plot.caption = element_text(color = "grey35", size = 10.5, hjust = 0,
margin = margin(t = 4)),
axis.title.x = element_text(size = 15.5, margin = margin(t = 7)),
axis.title.y = element_text(size = 15.5, margin = margin(r = 7)),
axis.title.x = element_text(size = AXIS_TITLE_SIZE,
margin = margin(t = 7)),
axis.title.y = element_text(size = AXIS_TITLE_SIZE,
margin = margin(r = 7)),
axis.text.x = element_text(size = 14, angle = 15, hjust = 1, vjust = 1),
axis.text.y = element_text(size = 12.5),
legend.position = "top",
legend.title = element_blank(),
legend.text = element_text(size = 13),
legend.key.size = unit(0.68, "cm"),
legend.key.height = unit(LEGEND_KEY_HEIGHT_CM, "cm"),
legend.key.width = unit(0.68, "cm"),
legend.box.spacing = unit(0.01, "cm"),
legend.margin = margin(0, 0, 0, 0),
panel.grid.major.x = element_blank(),
Expand Down Expand Up @@ -249,9 +252,10 @@ OUTLIER_HEADROOM <- 1.15
# extent are fractions of the panel height (axis space), so they look the
# same on linear, pseudo-log, and log axes.
LABEL_SIZE <- 3.6
LABEL_GAP <- 0.015
LABEL_EXTENT_BASE <- 0.01
LABEL_EXTENT_PER_CHAR <- 0.028
LABEL_HEIGHT_SCALE <- 3.95 / PLOT_HEIGHT_IN
LABEL_GAP <- 0.015 * LABEL_HEIGHT_SCALE
LABEL_EXTENT_BASE <- 0.01 * LABEL_HEIGHT_SCALE
LABEL_EXTENT_PER_CHAR <- 0.028 * LABEL_HEIGHT_SCALE
format_metric_value <- function(value, normalize) {
if (normalize) {
return(if (value >= 100) sprintf("%.0f", value)
Expand Down Expand Up @@ -781,7 +785,8 @@ main <- function() {
w <- max(6.4, n_bm * 0.9 + 1.4)

save_plot <- function() {
ggsave(filepath, p, width = w, height = 3.95, device = PDF_DEVICE)
ggsave(filepath, p, width = w, height = PLOT_HEIGHT_IN,
device = PDF_DEVICE)
}
if (HAS_GGPATTERN && log_scale && metric_key %in% LOG_SCALE_METRICS) {
# ggpattern bars still originate at y = 0 internally, so log-scale
Expand Down
Loading