aboutsummaryrefslogtreecommitdiff
path: root/bench/Main.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bench/Main.hs')
-rw-r--r--bench/Main.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/bench/Main.hs b/bench/Main.hs
index c4d2879..8f3b670 100644
--- a/bench/Main.hs
+++ b/bench/Main.hs
@@ -20,6 +20,10 @@ main = defaultMain
let n = 1_000_000
in nf (\(a, b) -> runScalar (rsumOuter1 (arithPromoteRanked2 (mliftPrim2 (*)) a b)))
(riota @Double n, riota n)
+ ,bench "sum(/) Double [1e6]" $
+ let n = 1_000_000
+ in nf (\(a, b) -> runScalar (rsumOuter1 (arithPromoteRanked2 (mliftPrim2 (/)) a b)))
+ (riota @Double n, riota n)
,bench "sum Double [1e6]" $
let n = 1_000_000
in nf (\a -> runScalar (rsumOuter1 a))
@@ -34,6 +38,10 @@ main = defaultMain
let n = 1_000_000
in nf (\(a, b) -> runScalar (rsumOuter1 (a * b)))
(riota @Double n, riota n)
+ ,bench "sum(/) Double [1e6]" $
+ let n = 1_000_000
+ in nf (\(a, b) -> runScalar (rsumOuter1 (a / b)))
+ (riota @Double n, riota n)
,bench "sum Double [1e6]" $
let n = 1_000_000
in nf (\a -> runScalar (rsumOuter1 a))
@@ -50,6 +58,11 @@ main = defaultMain
in nf (\(a, b) -> LA.sumElements (a * b))
(LA.linspace @Double n (0.0, fromIntegral (n - 1))
,LA.linspace @Double n (0.0, fromIntegral (n - 1)))
+ ,bench "sum(/) Double [1e6]" $
+ let n = 1_000_000
+ in nf (\(a, b) -> LA.sumElements (a / b))
+ (LA.linspace @Double n (0.0, fromIntegral (n - 1))
+ ,LA.linspace @Double n (0.0, fromIntegral (n - 1)))
,bench "sum Double [1e6]" $
let n = 1_000_000
in nf (\a -> LA.sumElements a)