Skip to content
Snippets Groups Projects
Commit 4b5153d6 authored by Jasper Van der Jeugt's avatar Jasper Van der Jeugt
Browse files

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.
parent da3cae75
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,6 @@ import System.FilePath ((</>)) ...@@ -10,7 +10,6 @@ import System.FilePath ((</>))
import System.IO (IOMode (WriteMode), openFile, hSetEncoding, utf8) import System.IO (IOMode (WriteMode), openFile, hSetEncoding, utf8)
import qualified Data.Text.Benchmarks.Builder as Builder 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.DecodeUtf8 as DecodeUtf8
import qualified Data.Text.Benchmarks.EncodeUtf8 as EncodeUtf8 import qualified Data.Text.Benchmarks.EncodeUtf8 as EncodeUtf8
import qualified Data.Text.Benchmarks.Equality as Equality import qualified Data.Text.Benchmarks.Equality as Equality
...@@ -39,7 +38,6 @@ benchmarks = do ...@@ -39,7 +38,6 @@ benchmarks = do
-- Traditional benchmarks -- Traditional benchmarks
bs <- sequence bs <- sequence
[ Builder.benchmark [ Builder.benchmark
, CaseMap.benchmark (tf "russian.txt") sink
, DecodeUtf8.benchmark (tf "russian.txt") , DecodeUtf8.benchmark (tf "russian.txt")
, EncodeUtf8.benchmark sink "επανάληψη 竺法蘭共譯" , EncodeUtf8.benchmark sink "επανάληψη 竺法蘭共譯"
, Equality.benchmark (tf "japanese.txt") , Equality.benchmark (tf "japanese.txt")
......
-- | 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment