This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed and updated benchmarks to the latest conduit and pipes-extra. Benchmarks are now integrated in cabal, so you can run them with something like: cabal configure --enable-benchmarks cabal build cabal bench
- Loading branch information
1 parent
d2266fd
commit 143b53b
Showing
8 changed files
with
67 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Criterion.Main | ||
import qualified Data.Conduit as C | ||
import qualified Data.Conduit.List as CL | ||
import qualified Data.Conduit.Binary as CB | ||
|
||
import Control.Pipe.Binary | ||
import Control.Pipe.Combinators | ||
import Control.Pipe | ||
|
||
testFile :: FilePath | ||
testFile = "bench/general.hs" | ||
|
||
main :: IO () | ||
main = defaultMain | ||
[ bench "bigsum-pipes" (whnfIO $ runPipe $ (mapM_ yield [1..1000 :: Int] >> return 0) >+> fold (+) 0) | ||
, bench "bigsum-conduit" (whnfIO $ C.runResourceT $ CL.sourceList [1..1000 :: Int] C.$$ CL.fold (+) 0) | ||
, bench "fileread-pipes" (whnfIO $ runPipe $ fileReader testFile >+> discard) | ||
, bench "fileread-conduit" (whnfIO $ C.runResourceT $ CB.sourceFile testFile C.$$ CL.sinkNull) | ||
, bench "map-pipes" (whnfIO $ runPipe $ (mapM_ yield [1..1000 :: Int] >> return 0) >+> pipe (+1) >+> fold (+) 0) | ||
, bench "map-conduit" (whnfIO $ C.runResourceT $ CL.sourceList [1..1000 :: Int] C.$= CL.map (+ 1) C.$$ CL.fold (+) 0) | ||
] |
File renamed without changes.
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