@@ -8,11 +8,12 @@ import Prelude hiding (lookup)
8import Data.Proxy (Proxy (..))
8import Data.Proxy (Proxy (..))
9import Data.Typeable (Typeable)
9import Data.Typeable (Typeable)
11−import Data.TypeRep.Map (TypeRepMap, empty, insert, lookup, size)
11+import Data.TypeRep.Map (TypeRepMap, empty, insert, lookup, size, dbgShowTree)
13main :: IO ()
13main :: IO ()
15 putStrLn $ "size: " ++ (show $ size bigMap)
15 putStrLn $ "size: " ++ (show $ size bigMap)
16+ putStrLn $ "tree:\n" ++ (dbgShowTree bigMap)
16 defaultMain
17 defaultMain
17 [ bench "lookup" $ whnf (lookup :: TypeRepMap -> Maybe Char) bigMap
18 [ bench "lookup" $ whnf (lookup :: TypeRepMap -> Maybe Char) bigMap
18 , bench "insert new" $ whnf (\x -> insert x bigMap) (111 :: Int)
19 , bench "insert new" $ whnf (\x -> insert x bigMap) (111 :: Int)
@@ -21,7 +22,7 @@ main = do
22-- TypeRepMap of 10000 elements
23-- TypeRepMap of 10000 elements
23bigMap :: TypeRepMap
24bigMap :: TypeRepMap
24−bigMap = buildBigMap 10000 (Proxy :: Proxy Z) empty
25+bigMap = buildBigMap 15 (Proxy :: Proxy Z) empty