diff options
| author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-01-15 21:30:26 +0100 |
|---|---|---|
| committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-01-15 21:30:26 +0100 |
| commit | bb1deceb98b4c7bfcd35372e0289566cb593d8a9 (patch) | |
| tree | a33c09c6e0b9c7d0cd846fd41df312c7db7a7d23 /bench | |
| parent | 103a4fa07ee16106261cfc627422353277667cf8 (diff) | |
Speed up sumFull from 36ms to 82 microseconds
Diffstat (limited to 'bench')
| -rw-r--r-- | bench/Main.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bench/Main.hs b/bench/Main.hs index 8fe0fdc..185bef0 100644 --- a/bench/Main.hs +++ b/bench/Main.hs @@ -176,6 +176,15 @@ tests_compare = ,bench "sum Double [1e6]" $ nf (\a -> runScalar (rsumOuter1Prim a)) (riota @Double n) + ,bench "sumAll iota [1e6]" $ + nf (\a -> rsumAllPrim a) + (riota @Double n) + ,bench "sumAll rev1(iota) [1e6]" $ + nf (\a -> rsumAllPrim a) + (rrev1 $ riota @Double n) + ,bench "sumAll reshape(iota) [1e6]" $ + nf (\a -> rsumAllPrim a) + (rreshape (1 :$: n :$: 1 :$: ZSR) $ riota @Double n) ] ,bgroup "NumElt" [bench "sum(+) Double [1e6]" $ |
