aboutsummaryrefslogtreecommitdiff
path: root/bench/Main.hs
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2025-05-13 19:58:12 +0200
committerTom Smeding <tom@tomsmeding.com>2025-05-13 19:58:12 +0200
commitbda0d3e9c1752d35488665ec19d39904f0dc4b49 (patch)
tree9c7035ccfe18a45a789060371606cad045603618 /bench/Main.hs
parent0c993d875a7cb9bace8aea1ef6def200de6b7d51 (diff)
Revert some stylistic changes
https://x.com/comerijn/status/1257804634833420292
Diffstat (limited to 'bench/Main.hs')
-rw-r--r--bench/Main.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/bench/Main.hs b/bench/Main.hs
index 45c1129..5901d8b 100644
--- a/bench/Main.hs
+++ b/bench/Main.hs
@@ -15,7 +15,7 @@ import Numeric.LinearAlgebra qualified as LA
import Test.Tasty.Bench
import Text.Show (showListWith)
-import Data.Array.Mixed.XArray (XArray (..))
+import Data.Array.Mixed.XArray (XArray(..))
import Data.Array.Nested
import Data.Array.Nested.Internal.Mixed (Mixed (M_Primitive), mliftPrim, mliftPrim2, toPrimitive)
import Data.Array.Nested.Internal.Ranked (liftRanked1, liftRanked2)
@@ -97,11 +97,11 @@ main_tests = defaultMain
,bgroup "orthotope"
[bench "normalize [1e6]" $
let n = 1_000_000
- in nf RS.normalize
+ in nf (\a -> RS.normalize a)
(RS.rev [0] (RS.iota @Double n))
,bench "normalize noop [1e6]" $
let n = 1_000_000
- in nf RS.normalize
+ in nf (\a -> RS.normalize a)
(RS.rev [0] (RS.rev [0] (RS.iota @Double n)))
]
,bgroupIf enableMisc "misc"
@@ -120,14 +120,14 @@ main_tests = defaultMain
[bench ("LA.vjoin [500]*1e" ++ show ni) $
let n = 10 ^ ni
k = 500
- in nf LA.vjoin
+ in nf (\as -> LA.vjoin as)
(replicate n (VS.enumFromTo (1::Int) k))
| ni <- [1::Int ..5]]
,bgroup "vectorStorable"
[bench ("VS.concat [500]*1e" ++ show ni) $
let n = 10 ^ ni
k = 500
- in nf VS.concat
+ in nf (\as -> VS.concat as)
(replicate n (VS.enumFromTo (1::Int) k))
| ni <- [1::Int ..5]]
]
@@ -136,14 +136,14 @@ main_tests = defaultMain
[bench ("LA.vjoin [1e" ++ show ki ++ "]*500") $
let n = 500
k = 10 ^ ki
- in nf LA.vjoin
+ in nf (\as -> LA.vjoin as)
(replicate n (VS.enumFromTo (1::Int) k))
| ki <- [1::Int ..5]]
,bgroup "vectorStorable"
[bench ("VS.concat [1e" ++ show ki ++ "]*500") $
let n = 500
k = 10 ^ ki
- in nf VS.concat
+ in nf (\as -> VS.concat as)
(replicate n (VS.enumFromTo (1::Int) k))
| ki <- [1::Int ..5]]
]
@@ -230,7 +230,7 @@ tests_compare =
nf (\a -> LA.sumElements (sin a))
(LA.linspace @Double n (0.0, fromIntegral (n - 1)))
,bench "sum Double [1e6]" $
- nf LA.sumElements
+ nf (\a -> LA.sumElements a)
(LA.linspace @Double n (0.0, fromIntegral (n - 1)))
,bench "dotprod Float [1e6]" $
nf (\(a, b) -> a LA.<.> b)