Skip to content

Commit c9a182c

Browse files
committed
add little microbenchmark
1 parent d677e4a commit c9a182c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

examples/boost-simd-dot.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,12 @@ lhs <- rnorm(10)
6262
rhs <- rnorm(10)
6363
result <- dot(lhs, rhs)
6464
all.equal(result, sum(lhs * rhs))
65+
66+
library(microbenchmark)
67+
lhs <- rnorm(1024 * 1000)
68+
rhs <- rnorm(1024 * 1000)
69+
microbenchmark(
70+
simd = dot(lhs, rhs),
71+
R = sum(lhs * rhs)
72+
)
6573
*/

0 commit comments

Comments
 (0)