summaryrefslogtreecommitdiff
path: root/bench/Main.hs
blob: 6748a95d9ff6d652bd5bf3e0d455058d6ee3521a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
module Main (main) where

import Criterion.Main
import Data.ByteString as BS
import Data.ByteString.Base32 as Base32
import Data.ByteString.Base32.Hex as Base32Hex

main :: IO ()
main = defaultMain
  [ bench "base32/encode/1M" $ nf Base32.encode
      $ BS.replicate 1000000 0x8e
  , bench "base32/encode/5M" $ nf Base32.encode
      $ BS.replicate 5000000 0x8e

  , bench "base32/decode/regular/1M" $ nf Base32.decode
      $ BS.replicate 1000000 0x41
  , bench "base32/decode/regular/5M" $ nf Base32.decode
      $ BS.replicate 5000000 0x41

--  , bench "base32/decode/lenient/1M" $ nf Base32.decodeLenient
--      $ BS.replicate 1000000 0x41
--  , bench "base32/decode/lenient/5M" $ nf Base32.decodeLenient
--      $ BS.replicate 5000000 0x41

  , bench "base32hex/encode/1M" $ nf Base32Hex.encode
      $ BS.replicate 1000000 0x8e
  , bench "base32hex/encode/5M" $ nf Base32Hex.encode
      $ BS.replicate 5000000 0x8e

  , bench "base32hex/decode/regular/1M" $ nf Base32Hex.decode
      $ BS.replicate 1000000 0x41
  , bench "base32hex/decode/regular/5M" $ nf Base32Hex.decode
      $ BS.replicate 5000000 0x41

--  , bench "base32hex/decode/lenient/1M" $ nf Base32Hex.decodeLenient
--      $ BS.replicate 1000000 0x41
--  , bench "base32hex/decode/lenient/5M" $ nf Base32Hex.decodeLenient
--      $ BS.replicate 5000000 0x41
  ]