Main.hs (761B)
1 {-# LANGUAGE OverloadedStrings #-} 2 3 module Main where 4 5 import Criterion.Main 6 import qualified Data.ByteString.Base58 as B58 7 import qualified Data.ByteString.Base58Check as B58C 8 9 main :: IO () 10 main = defaultMain [ 11 base32 12 ] 13 14 base32 :: Benchmark 15 base32 = bgroup "ppad-base32" [ 16 bgroup "base58" [ 17 bgroup "encode" [ 18 bench "hello world" $ nf B58.encode "hello world" 19 ] 20 , bgroup "decode" [ 21 bench "StV1DL6CwTryKyV" $ nf B58.decode "StV1DL6CwTryKyV" 22 ] 23 ] 24 , bgroup "base58check" [ 25 bgroup "encode" [ 26 bench "0x00, hello world" $ nf (B58C.encode 0x00) "hello world" 27 ] 28 , bgroup "decode" [ 29 bench "13vQB7B6MrGQZaxCqW9KER" $ 30 nf B58C.decode "13vQB7B6MrGQZaxCqW9KER" 31 ] 32 ] 33 ]