diff options
author | Clint Adams <clint@debian.org> | 2018-03-28 21:28:55 -0400 |
---|---|---|
committer | Clint Adams <clint@debian.org> | 2018-03-28 21:28:55 -0400 |
commit | d2606ed73301db7ab353a49d54d8fa2330000dcb (patch) | |
tree | 915a26acb73243af7914b7c0075540dcf356a61d | |
parent | 48db4d9b2692d3d1b964234256f7b0f95781252f (diff) |
Add benchmark
-rw-r--r-- | bench/mark.hs | 16 | ||||
-rw-r--r-- | openpgp-asciiarmor.cabal | 14 |
2 files changed, 28 insertions, 2 deletions
diff --git a/bench/mark.hs b/bench/mark.hs new file mode 100644 index 0000000..8251823 --- /dev/null +++ b/bench/mark.hs | |||
@@ -0,0 +1,16 @@ | |||
1 | -- mark.hs: openpgp-asciiarmor benchmark suite | ||
2 | -- Copyright © 2018 Clint Adams | ||
3 | -- This software is released under the terms of the ISC license. | ||
4 | -- (See the LICENSE file). | ||
5 | |||
6 | {-# LANGUAGE FlexibleContexts, OverloadedStrings #-} | ||
7 | |||
8 | import Criterion.Main | ||
9 | |||
10 | import Data.Digest.CRC24 | ||
11 | |||
12 | main :: IO () | ||
13 | main = defaultMain [ | ||
14 | bgroup "crc" [ bench "crc24" $ whnf crc24 "test" | ||
15 | ] | ||
16 | ] | ||
diff --git a/openpgp-asciiarmor.cabal b/openpgp-asciiarmor.cabal index 74711e7..be6a08d 100644 --- a/openpgp-asciiarmor.cabal +++ b/openpgp-asciiarmor.cabal | |||
@@ -42,7 +42,7 @@ Library | |||
42 | , base64-bytestring | 42 | , base64-bytestring |
43 | , bytestring | 43 | , bytestring |
44 | , cereal | 44 | , cereal |
45 | default-language: Haskell98 | 45 | default-language: Haskell2010 |
46 | 46 | ||
47 | 47 | ||
48 | Test-Suite tests | 48 | Test-Suite tests |
@@ -57,7 +57,17 @@ Test-Suite tests | |||
57 | , HUnit | 57 | , HUnit |
58 | , test-framework | 58 | , test-framework |
59 | , test-framework-hunit | 59 | , test-framework-hunit |
60 | default-language: Haskell98 | 60 | default-language: Haskell2010 |
61 | |||
62 | Benchmark benchmark | ||
63 | type: exitcode-stdio-1.0 | ||
64 | main-is: bench/mark.hs | ||
65 | Ghc-options: -Wall | ||
66 | Build-depends: openpgp-asciiarmor | ||
67 | , base | ||
68 | , bytestring | ||
69 | , criterion | ||
70 | default-language: Haskell2010 | ||
61 | 71 | ||
62 | source-repository head | 72 | source-repository head |
63 | type: git | 73 | type: git |