-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
235 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
-- | | ||
-- Module : Streamly.Benchmark.Data.Ring | ||
-- Module : Streamly.Benchmark.Data.RingArray | ||
-- Copyright : (c) 2022 Composewell | ||
-- License : BSD-3-Clause | ||
-- Maintainer : [email protected] | ||
|
@@ -12,7 +12,7 @@ module Main (main) where | |
|
||
import qualified Streamly.Internal.Data.Array as Array | ||
import qualified Streamly.Internal.Data.MutArray as MutArray | ||
import qualified Streamly.Internal.Data.Ring as Ring | ||
import qualified Streamly.Internal.Data.RingArray as RingArray | ||
|
||
import Test.Tasty.Bench | ||
import Streamly.Benchmark.Common | ||
|
@@ -23,17 +23,17 @@ import Prelude as P | |
-- Benchmark ops | ||
------------------------------------------------------------------------------- | ||
|
||
eqArrayN :: (Int, Array.Array Int, Ring.Ring Int) -> IO Bool | ||
eqArrayN (value, arr, ring) = Ring.eqArrayN ring arr value | ||
eqArrayN :: (Int, Array.Array Int, RingArray.RingArray Int) -> IO Bool | ||
eqArrayN (value, arr, ring) = RingArray.eqArrayN ring arr value | ||
|
||
eqArray :: (Array.Array Int, Ring.Ring Int) -> IO Bool | ||
eqArray (arr, ring) = Ring.eqArray ring arr | ||
eqArray :: (Array.Array Int, RingArray.RingArray Int) -> IO Bool | ||
eqArray (arr, ring) = RingArray.eqArray ring arr | ||
|
||
------------------------------------------------------------------------------- | ||
-- Benchmark groups | ||
------------------------------------------------------------------------------- | ||
|
||
o_1_space_serial :: Int -> Array.Array Int -> Ring.Ring Int -> [Benchmark] | ||
o_1_space_serial :: Int -> Array.Array Int -> RingArray.RingArray Int -> [Benchmark] | ||
o_1_space_serial value arr ring = | ||
[ bench "eqArrayN" $ nfIO $ eqArrayN (value, arr, ring) | ||
, bench "eqArray" $ nfIO $ eqArray (arr, ring) | ||
|
@@ -44,7 +44,7 @@ o_1_space_serial value arr ring = | |
------------------------------------------------------------------------------- | ||
|
||
moduleName :: String | ||
moduleName = "Data.Ring" | ||
moduleName = "Data.RingArray" | ||
|
||
main :: IO () | ||
main = do | ||
|
@@ -56,7 +56,7 @@ main = do | |
let input = [1 .. value] :: [Int] | ||
let arr = Array.fromList input | ||
marr <- MutArray.fromList input | ||
let ring = maybe (error "cast failed") id (Ring.castMutArray marr) | ||
let ring = maybe (error "cast failed") id (RingArray.castMutArray marr) | ||
|
||
return (arr, ring) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.