[commit: packages/containers] develop-0.6, develop-0.6-questionable, master: Add simple fromFunction benchmarks. (a556ef2)
git at git.haskell.org
git at git.haskell.org
Fri Jan 23 22:42:31 UTC 2015
Repository : ssh://git@git.haskell.org/containers
On branches: develop-0.6,develop-0.6-questionable,master
Link : http://git.haskell.org/packages/containers.git/commitdiff/a556ef225952c27731a00b24b6417b6a057507ce
>---------------------------------------------------------------
commit a556ef225952c27731a00b24b6417b6a057507ce
Author: Milan Straka <fox at ucw.cz>
Date: Mon Dec 15 14:47:20 2014 +0100
Add simple fromFunction benchmarks.
>---------------------------------------------------------------
a556ef225952c27731a00b24b6417b6a057507ce
benchmarks/Sequence.hs | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/benchmarks/Sequence.hs b/benchmarks/Sequence.hs
index 8bc2d74..b6b82fa 100644
--- a/benchmarks/Sequence.hs
+++ b/benchmarks/Sequence.hs
@@ -37,6 +37,13 @@ main = do
, bench "nf100" $ nf (uncurry S.zip) (s100, u100)
, bench "nf10000" $ nf (uncurry S.zip) (s10000, u10000)
]
+ , bgroup "fromFunction"
+ [ bench "ix10000/5000" $ nf (\s -> S.fromFunction s (+1) `S.index` (s `div` 2)) 10000
+ , bench "nf10" $ nf (\s -> S.fromFunction s (+1)) 10
+ , bench "nf100" $ nf (\s -> S.fromFunction s (+1)) 100
+ , bench "nf1000" $ nf (\s -> S.fromFunction s (+1)) 1000
+ , bench "nf10000" $ nf (\s -> S.fromFunction s (+1)) 10000
+ ]
]
-- splitAt+append: repeatedly cut the sequence at a random point
More information about the ghc-commits
mailing list