Skip to content

Commit 5173f39

Browse files
committed
check CXX standards
1 parent abaa531 commit 5173f39

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

scripts/bench_loop.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# for std in CXX23 CXX20 CXX17 CXX14 CXX11; do
5-
for std in CXX23; do
4+
for std in CXX23 CXX20 CXX17 CXX14 CXX11; do
65
for compiler in clang gcc; do
76
echo "==============================="
87
echo "Benchmarking R code with $std standard and $compiler compiler"

scripts/combine-benchmarks.R

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,16 @@ res <- res %>%
162162
rel_time_cpp11 = signif(rel_time_cpp11, 3),
163163
rel_time_cpp4r = signif(rel_time_cpp4r, 3),
164164
rel_time_Rcpp = signif(rel_time_Rcpp, 3)
165-
) %>%
165+
)
166+
167+
# add cpp4/cpp11 time and cpp4r/Rcpp time ratios
168+
res <- res %>%
169+
mutate(
170+
rel_cpp4r_cpp11 = signif(rel_time_cpp4r / rel_time_cpp11, 3),
171+
rel_cpp4r_Rcpp = signif(rel_time_cpp4r / rel_time_Rcpp, 3)
172+
)
173+
174+
res <- res %>%
166175
mutate(
167176
avg_time_cpp11 = paste(avg_time_cpp11, paste0("(", rel_time_cpp11, ")")),
168177
avg_time_cpp4r = paste(avg_time_cpp4r, paste0("(", rel_time_cpp4r, ")")),

scripts/run-benchmark.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cpp_compiler <- "gcc"
2-
cpp_std <- "CXX23"
2+
cpp_std <- "CXX11"
33

44
library(bench)
55
library(cpp11benchmark)

0 commit comments

Comments
 (0)