[commit: packages/containers] develop-0.6, develop-0.6-questionable, master, zip-devel: Add zip benchmarks (cdf173f)

git at git.haskell.org git at git.haskell.org
Fri Jan 23 22:40:31 UTC 2015


Repository : ssh://git@git.haskell.org/containers

On branches: develop-0.6,develop-0.6-questionable,master,zip-devel
Link       : http://git.haskell.org/packages/containers.git/commitdiff/cdf173f4cb1f792a4ac54b939bf197c214abcd43

>---------------------------------------------------------------

commit cdf173f4cb1f792a4ac54b939bf197c214abcd43
Author: David Feuer <David.Feuer at gmail.com>
Date:   Wed Dec 3 12:31:45 2014 -0500

    Add zip benchmarks


>---------------------------------------------------------------

cdf173f4cb1f792a4ac54b939bf197c214abcd43
 benchmarks/Sequence.hs | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/benchmarks/Sequence.hs b/benchmarks/Sequence.hs
index 8c18582..ccaca6c 100644
--- a/benchmarks/Sequence.hs
+++ b/benchmarks/Sequence.hs
@@ -20,10 +20,16 @@ main = do
         r1000 = rlist 1000
     rnf [r10, r100, r1000] `seq` return ()
     defaultMain
-        [ bench "splitAt/append 10" $ nf (shuffle r10) s10
-        , bench "splitAt/append 100" $ nf (shuffle r100) s100
-        , bench "splitAt/append 1000" $ nf (shuffle r1000) s1000
-        ]
+      [ bgroup "splitAt/append"
+         [ bench "10" $ nf (shuffle r10) s10
+         , bench "100" $ nf (shuffle r100) s100
+         , bench "1000" $ nf (shuffle r1000) s1000
+         ]
+      , bgroup "zip"
+         [ bench "ix10000/5000" $ nf (\(xs,ys) -> S.zip xs ys `S.index` 5000) (S.replicate 10000 (), S.fromList [1..10000::Int])
+         , bench "nf150" $ nf (uncurry S.zip) (S.fromList [1..150::Int], S.replicate 150 ())
+         , bench "nf10000" $ nf (uncurry S.zip) (S.fromList [1..10000::Int], S.replicate 10000 ())
+         ] ]
 
 -- splitAt+append: repeatedly cut the sequence at a random point
 -- and rejoin the pieces in the opposite order.



More information about the ghc-commits mailing list