1
1
# touchstone:::touchstone_clear() # deletes itself and sources
2
2
refs <- c(Sys.getenv(" GITHUB_BASE_REF" , " touchstone" ), Sys.getenv(" GITHUB_HEAD_REF" , " touchstone" ))
3
- exprs_to_benchmark <- list (
3
+
4
+ timer <- purrr :: partial(touchstone :: benchmark_run_ref ,
5
+ refs = refs , n = 10
6
+ )
7
+
8
+ timer(
9
+ expr_before_benchmark = c(" library(styler)" , " cache_deactivate()" ),
10
+ without_cache = ' style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))'
11
+ )
12
+
13
+ timer(
14
+ expr_before_benchmark = c(" library(styler)" , " cache_activate()" ),
4
15
cache_applying = ' style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))'
5
16
)
6
- for (benchmark in names(exprs_to_benchmark )) {
7
- timings <- touchstone :: benchmark_run_ref(
8
- refs ,
9
- expr_before_benchmark = c(" library(styler)" , " cache_deactivate()" ),
10
- !!! exprs_to_benchmark [[benchmark ]],
11
- n = 10
12
- )
13
17
18
+ timer(
19
+ expr_before_benchmark = c(" library(styler)" , " gert::git_reset_hard(repo = 'touchstone/sources/here')" , " cache_activate()" ),
20
+ cache_recording = ' style_pkg("touchstone/sources/here", filetype = c("R", "rmd"))'
21
+ )
22
+
23
+
24
+ for (benchmark in touchstone :: benchmark_ls()) {
14
25
timings <- touchstone :: benchmark_read(benchmark , refs [1 ])
15
26
16
27
library(ggplot2 )
@@ -30,6 +41,7 @@ for (benchmark in names(exprs_to_benchmark)) {
30
41
diff_percent <- round(100 * (tbl [refs [2 ]] - tbl [refs [1 ]]) / tbl [refs [1 ]], 1 )
31
42
cat(
32
43
glue :: glue(" {benchmark}: round(tbl[refs[1]], 2)} -> {round(tbl[refs[2]], 2)} ({diff_percent}%)" ),
44
+ fill = TRUE ,
33
45
file = " touchstone/pr-comment/info.txt" ,
34
46
append = TRUE
35
47
)
0 commit comments