Skip to content

Commit 52ae455

Browse files
at least one iteration of each, write diff
1 parent 51df68c commit 52ae455

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

touchstone/script.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ timings <- touchstone::benchmark_run_ref(
55
refs,
66
expr_before_benchmark = c("library(styler)", "cache_deactivate()"),
77
expr_to_benchmark = 'style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))',
8-
n = 1,
8+
n = 2,
99
)
1010

1111
timings <- touchstone::benchmark_read(refs)
@@ -17,3 +17,11 @@ timings %>%
1717
geom_density()
1818

1919
ggsave("touchstone/plots/density.png")
20+
21+
tbl <- timings %>%
22+
dplyr::group_by(.data$ref) %>%
23+
dplyr::summarise(m = mean(.data$elapsed)) %>%
24+
tibble::deframe()
25+
26+
diff_percent <- round(100 * (tbl[ref[2]] - tbl[ref[1]]) / tbl[ref[1]])
27+
writeLines(glue::glue('{tbl[ref[2]]} -> {tbl[ref[1]]} ({diff_percent}%)'), 'touchstone/pr-comment/info.txt')

0 commit comments

Comments
 (0)