@@ -24,8 +24,12 @@ for (pr_file in pr_files) {
2424 # Prepare a report
2525 report <- list ()
2626
27+ # Use deparse1 for reliable expression-to-string conversion;
28+ # as.character(unlist()) decomposes call objects into their components.
29+ expr_names <- vapply(pr1 [[" expression" ]], deparse1 , " " )
30+
2731 # Iterate over each function benchmarked
28- for (fn_name in unique(as.character(unlist( pr1 [[ " expression " ]])) )) {
32+ for (fn_name in unique(expr_names )) {
2933 pr1_times <- as.numeric(pr1 [[" time" ]][[1 ]])
3034 pr2_times <- as.numeric(pr2 [[" time" ]][[1 ]])
3135 pr_times <- if (rep_exists ) c(pr1_times , pr2_times ) else pr1_times
@@ -79,18 +83,21 @@ for (pr_file in pr_files) {
7983 # Create a markdown-formatted message
8084 has_significant_regression <- FALSE
8185
82- for (fn_name in names(report )) {
83- res <- report [[fn_name ]]
84- status <- if (res $ matched ) {
86+ for (i in seq_along(report )) {
87+ fn_name <- names(report )[[i ]]
88+ res <- report [[i ]]
89+ if (is.null(res ) || is.null(res $ matched )) next
90+
91+ status <- if (isTRUE(res $ matched )) {
8592 if (res $ slower ) {
86- if (abs(percentage_change ) > threshold_percent ) {
93+ if (abs(res $ change ) > threshold_percent ) {
8794 has_significant_regression <- TRUE
8895 " \U 1F7E0 Slower \U 1F641"
8996 } else {
9097 " \U 1F7E3 ~same"
9198 }
9299 } else if (res $ faster ) {
93- if (abs(percentage_change ) > threshold_percent ) {
100+ if (abs(res $ change ) > threshold_percent ) {
94101 " \U 1F7E2 Faster!"
95102 } else {
96103 " \U 1F7E3 ~same"
@@ -111,14 +118,14 @@ for (pr_file in pr_files) {
111118 signif(res $ median_pr * 1e3 , 3 ), " , " ,
112119 signif(res $ median_cf * 1e3 , 3 ), " |\n "
113120 )
121+
122+ cat(message )
123+ output <- paste0(output , message )
114124 }
115125
116126 if (has_significant_regression ) {
117127 regressions <- TRUE
118128 }
119-
120- cat(message )
121- output <- paste0(output , message )
122129}
123130
124131cat(paste0(output , " \n EOF" ), file = Sys.getenv(" GITHUB_OUTPUT" ), append = TRUE )
0 commit comments