Bryan O'Sullivan avatar Bryan O'Sullivan committed e07b981

Update source list, make Judy compile.

Comments (0)

Files changed (3)

 build-type:     Simple
 cabal-version:  >= 1.2
 extra-source-files:
-  README examples/Fibber.hs examples/Judy.hs
+  README
+  examples/Fibber.hs
+  examples/Judy.hs
+  examples/Makefile
+  examples/Tiny.hs
 description:
   This library provides a powerful but simple way to measure the
   performance of Haskell code.  It provides both a framework for
 
 main = defaultMainWith myConfig [
         bgroup "judy" [
-                     bench "insert 1M"   (testit 1000000)
-                   , bench "insert 10M"  (testit 10000000)
-                   , bench "insert 100M" (testit 100000000)
+                     bench "insert 1M"   $ B testit 1000000
+                   , bench "insert 10M"  $ B testit 10000000
+                   , bench "insert 100M" $ B testit 100000000
                    ],
         bgroup "map" [
-                      bench "insert 100k" (testmap 100000)
-                   , bench "insert 1M"    (testmap 1000000)
+                     bench "insert 100k" $ B testmap 100000
+                   , bench "insert 1M"   $ B testmap 1000000
                    ],
         bgroup "intmap" [
-                     bench "insert 100k" (testintmap 100000)
-                   , bench "insert 1M"   (testintmap 1000000)
+                     bench "insert 100k" $ B testintmap 100000
+                   , bench "insert 1M"   $ B testintmap 1000000
                    ]
     ]
 
    v <- J.lookup 100 j
    v `seq` return ()
 
-testmap :: Int -> Int -> M.Map Int Int
-testmap n i =
-    foldl' (\m k -> M.insert k 1 m) M.empty [0..(n+i-i)]
+testmap :: Int -> M.Map Int Int
+testmap n =
+    foldl' (\m k -> M.insert k 1 m) M.empty [0..n]
 
-testintmap :: Int -> Int -> I.IntMap Int
-testintmap n i =
-    foldl' (\m k -> I.insert k 1 m) I.empty [0..(n+i-i)]
+testintmap :: Int -> I.IntMap Int
+testintmap n =
+    foldl' (\m k -> I.insert k 1 m) I.empty [0..n]

examples/Makefile

-all := Fibber Tiny
+all := Fibber Judy Tiny
 
 all: $(all)
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.