7import Criterion.Main (bgroup, defaultMain)
9import Spec (BenchSpec (..))
11import qualified CacheMap
13#if ( __GLASGOW_HASKELL__ >= 802 )
16import qualified OptimalVector as OptVec
21 let specs = [("CMap", CMap.spec)
22 ,("CacheMap", CacheMap.spec)
23#if ( __GLASGOW_HASKELL__ >= 802 )
26 , ("OptVec", OptVec.spec)
28 {- This code creates a benchmark group. Given a getter
29 (that is test description) it gets a benchmark generation
30 function from each module spec. Benchmark generation
31 function takes a label and generate benchmarks. It's
32 possible to introduce parameters passing in the same way.
34 let mkGroup getBenchmark =
36 | (label, spec) <- specs
37 -- Here we use pure to force pattern matching in List
38 -- then in case of pattern match failure `mzero` will
39 -- be called, so benchmark will be ignored.
40 , Just mkBenchmark <- pure $ getBenchmark spec
43 [ bgroup "lookup" $ mkGroup benchLookup
45 [ bgroup "10 elements to empty" $ mkGroup benchInsertSmall
46 , bgroup "1 element to big map" $ mkGroup benchInsertBig
49 [ bgroup "10 elements to empty" $ mkGroup benchUpdateSmall
50 , bgroup "1 element to big map" $ mkGroup benchUpdateBig
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list