Skip to content

Commit 18de235

Browse files
committed
Fix AVL benchmarks
1 parent 15a5393 commit 18de235

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/benchmark.hs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ main = do microbench "insNode into AVL tree" insNodeAVL
5656
microbench "buildFull into PATRICIA tree 500" (buildFullPatricia 500)
5757
microbench "buildFull into PATRICIA tree 1000" (buildFullPatricia 1000)
5858

59-
-- microbench "insEdge into AVL tree" insEdgeAVL
59+
microbench "insEdge into AVL tree" insEdgeAVL
6060
microbench "insEdge into PATRICIA tree" insEdgePatricia
6161

6262
microbench "gmap on AVL tree" gmapAVL
@@ -65,7 +65,7 @@ main = do microbench "insNode into AVL tree" insNodeAVL
6565
microbench "nmap on AVL tree" nmapAVL
6666
microbench "nmap on PATRICIA tree" nmapPatricia
6767

68-
-- microbench "emap on AVL tree" emapAVL
68+
microbench "emap on AVL tree" emapAVL
6969
microbench "emap on PATRICIA tree" emapPatricia
7070

7171

@@ -107,9 +107,10 @@ insEdgePatricia n = insEdges' (insNodePatricia n) n
107107
{-# INLINE insEdges' #-}
108108
insEdges' :: DynGraph gr => gr a () -> Int -> gr a ()
109109
insEdges' g 0 = g
110-
insEdges' g n = let g' = insEdge (1, n, ()) g
110+
insEdges' g n = let n' = n - 1
111+
g' = insEdge (0, n', ()) g
111112
in
112-
insEdges' g' (n - 1)
113+
insEdges' g' n'
113114

114115

115116
gmapAVL :: Int -> AVL.Gr Int ()

0 commit comments

Comments
 (0)