[Haskell-cafe] Data.ByteStream.Char8.words performance
dino at ui3.info
Fri Mar 30 21:10:30 EDT 2007
On Fri, 30 Mar 2007, Jeremy Shaw wrote:
> Did you compile with -O2 ? That makes a huge difference when using ByteString.
Ah, that was exactly it. I feel silly.
> module Main where
> import qualified Data.ByteString.Char8 as B
> main = do
> content <- B.readFile "test-text-file"
> let l = length . B.words $ content
> print l
$ ghc -O2 count-b.hs
$ time ./a.out
Much faster. Thank you!
More information about the Haskell-Cafe