aboutsummaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-05-26 14:57:34 +0200
committerTom Smeding <tom@tomsmeding.com>2024-05-26 14:57:34 +0200
commite80b2593edc3d216905279ebcfa797593a1efbfc (patch)
tree5e5057e03f35369983f6600efc59c438c0cf2366 /bench
parent2ac16efe59051e0cdeb37422ab579c8d354d562a (diff)
Fast Fractional ops via C code
Diffstat (limited to 'bench')
-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)