File: Main.hs

package info (click to toggle)
haskell-text-builder-linear 0.1.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: haskell: 2,021; makefile: 3
file content (36 lines) | stat: -rw-r--r-- 885 bytes parent folder | download
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
-- |
-- Copyright:   (c) 2022 Andrew Lelechenko
-- Licence:     BSD3
-- Maintainer:  Andrew Lelechenko <andrew.lelechenko@gmail.com>
module Main where

import Test.Tasty.Bench
import Test.Tasty.Patterns.Printer

import BenchChar
import BenchDecimal
import BenchDecimalUnbounded (benchDecimalUnbounded)
import BenchDouble
import BenchHexadecimal
import BenchText

main ∷ IO ()
main =
  defaultMain $
    map (mapLeafBenchmarks addCompare) $
      [ benchText
      , benchChar
      , benchDecimal
      , benchDecimalUnbounded
      , benchHexadecimal
      , benchDouble
      ]

textBenchName ∷ String
-- textBenchName = "Data.Text.Lazy.Builder"
textBenchName = "Data.ByteString.Builder"

addCompare ∷ ([String] → Benchmark → Benchmark)
addCompare (name : path)
  | name /= textBenchName = bcompare (printAwkExpr (locateBenchmark (textBenchName : path)))
addCompare _ = id