[Haskell-cafe] Bytestrings and [Char]

Johann Höchtl johann.hoechtl at gmail.com
Tue Mar 23 15:59:22 EDT 2010



Bryan O'Sullivan wrote:
> 2010/3/23 Iustin Pop <iusty at k1024.org <mailto:iusty at k1024.org>>
>
>     I agree with the principle of correctness, but let's be honest - it's
>     (many) orders of magnitude between ByteString and String and Text, not
>     just a few percentage points…
>
>
> Well, your benchmarks are highly suspect. See below.
>  
>
>     Data.ByteString.Lazy.UTF8 (system readFile + fromString + length) - 11
>     seconds, correct length.
>
>
> You should be using bytestring I/O for this.
>  
>
>     Data.Text.Lazy (system readFile + pack + length) - 26s, correct
>     length.
>
>
> You should be using text I/O for this.
This is certainly true but adds some unfortunate bloat and has the taste 
of Java libraries, which define a plethora of similar, but not 
interchangeable methods due to legacy.


More information about the Haskell-Cafe mailing list