Commits

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.

Comments (0)

Files changed (2)

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

 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")

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

--- | 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