From e1467acc516609c24095d048f992f63cc306d99a Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 20 May 2024 23:26:11 +0200 Subject: WIP benchmark file --- bench/Main.hs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 bench/Main.hs (limited to 'bench/Main.hs') diff --git a/bench/Main.hs b/bench/Main.hs new file mode 100644 index 0000000..d8582fe --- /dev/null +++ b/bench/Main.hs @@ -0,0 +1,20 @@ +{-# LANGUAGE NumericUnderscores #-} +{-# LANGUAGE TypeApplications #-} +module Main where + +import Test.Tasty.Bench + +import Data.Array.Nested + + +main :: IO () +main = defaultMain + [bgroup "Num" + [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, b) -> runScalar (rsumOuter1 (a + b))) + (riota @Double n, riota n)]] -- cgit v1.2.3-70-g09d2