[Haskell-cafe] Re: String vs ByteString
illissius at gmail.com
Fri Aug 13 11:25:58 EDT 2010
On Fri, Aug 13, 2010 at 4:43 PM, Johan Tibell <johan.tibell at gmail.com> wrote:
> On Fri, Aug 13, 2010 at 4:24 PM, Kevin Jardine <kevinjardine at gmail.com>
>> I'm interested to see this kind of open debate on performance,
>> especially about libraries that provide widely used data structures
>> such as strings.
>> One of the more puzzling aspects of Haskell for newbies is the large
>> number of libraries that appear to provide similar/duplicate
>> The Haskell Platform deals with this to some extent, but it seems to
>> me that if there are new libraries that appear to provide performance
>> boosts over more widely used libraries, it would be best if the new
>> code gets incorporated into the existing more widely used libraries
>> rather than creating more code to maintain / choose from.
>> I think that open debate about performance trade-offs could help
>> consolidate the libraries.
> I agree.
> Here's a rule of thumb: If you have binary data, use Data.ByteString. If you
> have text, use Data.Text. Those libraries have benchmarks and have been well
> tuned by experienced Haskelleres and should be the fastest and most memory
> compact in most cases. There are still a few cases where String beats Text
> but they are being worked on as we speak.
How about the case for text which is guaranteed to be in ascii/latin1?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
Work is punishment for failing to procrastinate effectively.
More information about the Haskell-Cafe