Skip to content

Commit 080c347

Browse files
meooow25jwaldmann
authored andcommitted
Add a large graph in Data.Graph benchmarks
1 parent e4e9fd3 commit 080c347

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

containers-tests/benchmarks/Graph.hs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ main = do
1212
evaluate $ rnf randGs
1313
defaultMain
1414
[ bgroup "buildG" $ forGs randGs $ \g -> nf (G.buildG (bounds (getG g))) (getEdges g)
15-
, bgroup "graphFromEdges" $ forGs randGs $ nf ((\(g, _, _) -> g) . G.graphFromEdges) . getAdjList
15+
, bgroup "graphFromEdges" $
16+
forGs [randG1, randG2, randG3] $ nf ((\(g, _, _) -> g) . G.graphFromEdges) . getAdjList
1617
, bgroup "dfs" $ forGs randGs $ nf (flip G.dfs [1]) . getG
1718
, bgroup "dff" $ forGs randGs $ nf G.dff . getG
1819
, bgroup "topSort" $ forGs randGs $ nf G.topSort . getG
1920
, bgroup "scc" $ forGs randGs $ nf G.scc . getG
2021
, bgroup "bcc" $ forGs [randG1, randG2] $ nf G.bcc . getG
21-
, bgroup "stronglyConnCompR" $ forGs randGs $ nf G.stronglyConnCompR . getAdjList
22+
, bgroup "stronglyConnCompR" $
23+
forGs [randG1, randG2, randG3] $ nf G.stronglyConnCompR . getAdjList
2224
]
2325
where
2426
randG1 = buildRandG 100 1000
2527
randG2 = buildRandG 100 10000
2628
randG3 = buildRandG 10000 100000
27-
randGs = [randG1, randG2, randG3]
29+
randG4 = buildRandG 100000 1000000
30+
randGs = [randG1, randG2, randG3, randG4]
2831

2932
-- Note: In practice it does not make sense to run topSort or bcc on a random
3033
-- graph. For topSort the graph should be acyclic and for bcc the graph should

0 commit comments

Comments
 (0)