on main help sign in
[#27] Add table with benchmark results to README (#35)

* [#27] Add table with benchmark results to README * Remove stack badges from README * Fix bench description

commitd91f137e71d12946ef54ce558cfb4979f74e1cea authorDmitrii Kovanikov <kovanikov@gmail.com> dateTue 10 Jul 2018, 17:47 (8 years ago) parentdccb742
1 file changed+17−2
README.md+17−2
README.md+17−2
@@ -2,12 +2,12 @@
22
33[![Hackage](https://img.shields.io/hackage/v/typerep-map.svg)](https://hackage.haskell.org/package/typerep-map)
44[![Build status](https://secure.travis-ci.org/kowainik/typerep-map.svg)](https://travis-ci.org/kowainik/typerep-map)
5−[![Stackage LTS](http://stackage.org/package/typerep-map/badge/lts)](http://stackage.org/lts/package/typerep-map)
6−[![Stackage Nightly](http://stackage.org/package/typerep-map/badge/nightly)](http://stackage.org/nightly/package/typerep-map)
75[![MIT license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/vrom911/typerep-map/blob/master/LICENSE)
86
97`typerep-map` introduces `TypeRepMap` — data structure like [`Map`](http://hackage.haskell.org/package/containers-0.6.0.1/docs/Data-Map-Lazy.html#t:Map), but where types serve as keys, and values have the types specified in the corresponding key spots.
108
9+## Usage example
10+
1111```haskell
1212ghci> let typeRepMap = insert (Identity True) $ one (Identity (42 :: Int))
1313
@@ -36,3 +36,18 @@ ghci> let trMap = delete @Int typeRepMap
3636ghci> member @Int trMap
3737False
3838```
39+
40+## Benchmarks
41+
42+Tables below contain comparision with `DMap TypeRep` of ten `lookup` operations
43+on structure with size `10^4`:
44+
45+| | ghc-8.2.2 | ghc-8.4.3 |
46+|----------------|-----------|-----------|
47+| `DMap TypeRep` | 517.5 ns | 779.9 ns |
48+| `typerep-map` | 205.3 ns | 187.2 ns |
49+
50+ ghc-8.2.2 | ghc-8.4.3
51+:---------:|:-----------:
52+![DMap 8.2.2](https://user-images.githubusercontent.com/4276606/42495129-c700f21e-8454-11e8-98b4-ba080259c712.png) | ![DMap 8.4.3](https://user-images.githubusercontent.com/4276606/42495168-ebb1d13c-8454-11e8-9d17-f6da29d2169a.png)
53+![TMap 8.2.2](https://user-images.githubusercontent.com/4276606/42494935-3a352d96-8454-11e8-985e-ebc77cc51ca0.png) | ![TMap 8.4.3](https://user-images.githubusercontent.com/4276606/42495147-d884bdf4-8454-11e8-887f-9815fd2b8d68.png)