Skip to content

Commit a556ef2

Browse files
committed
Add simple fromFunction benchmarks.
1 parent b38f240 commit a556ef2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

benchmarks/Sequence.hs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ main = do
3737
, bench "nf100" $ nf (uncurry S.zip) (s100, u100)
3838
, bench "nf10000" $ nf (uncurry S.zip) (s10000, u10000)
3939
]
40+
, bgroup "fromFunction"
41+
[ bench "ix10000/5000" $ nf (\s -> S.fromFunction s (+1) `S.index` (s `div` 2)) 10000
42+
, bench "nf10" $ nf (\s -> S.fromFunction s (+1)) 10
43+
, bench "nf100" $ nf (\s -> S.fromFunction s (+1)) 100
44+
, bench "nf1000" $ nf (\s -> S.fromFunction s (+1)) 1000
45+
, bench "nf10000" $ nf (\s -> S.fromFunction s (+1)) 10000
46+
]
4047
]
4148

4249
-- splitAt+append: repeatedly cut the sequence at a random point

0 commit comments

Comments
 (0)