1. Bryan O'Sullivan
  2. text


Jasper Van der Jeugt  committed ded1a56

Remove the CaseMap benchmark

This benchmark has no real value. We already have a
benchmark for a pure map in the Pure module. Adding
IO to the CaseMap benchmark just causes IO to outweigh
the map function, so the results aren't very useful.

  • Participants
  • Parent commits 6ba95f6
  • Branches default

Comments (0)

Files changed (2)

File tests/benchmarks/src/Data/Text/Benchmarks.hs

View file
  • Ignore whitespace
 import System.IO (IOMode (WriteMode), openFile, hSetEncoding, utf8)
 import qualified Data.Text.Benchmarks.Builder as Builder
-import qualified Data.Text.Benchmarks.CaseMap as CaseMap
 import qualified Data.Text.Benchmarks.DecodeUtf8 as DecodeUtf8
 import qualified Data.Text.Benchmarks.EncodeUtf8 as EncodeUtf8
 import qualified Data.Text.Benchmarks.Equality as Equality
     -- Traditional benchmarks
     bs <- sequence
         [ Builder.benchmark
-        , CaseMap.benchmark (tf "russian.txt") sink
         , DecodeUtf8.benchmark (tf "russian.txt")
         , EncodeUtf8.benchmark sink "επανάληψη 竺法蘭共譯"
         , Equality.benchmark (tf "japanese.txt")

File tests/benchmarks/src/Data/Text/Benchmarks/CaseMap.hs

  • Ignore whitespace
--- | This benchmark converts a number of UTF-8 encoded files to uppercase
-module Data.Text.Benchmarks.CaseMap
-    ( benchmark
-    ) where
-import Criterion (Benchmark, bench)
-import System.IO (Handle)
-import qualified Data.ByteString as B
-import qualified Data.Text as T
-import qualified Data.Text.Encoding as T
-benchmark :: FilePath -> Handle -> IO Benchmark
-benchmark fp sink = return $ bench "CaseMap" $
-    B.readFile fp >>= B.hPutStr sink . T.encodeUtf8 . T.toUpper . T.decodeUtf8