[Haskell-cafe] Bytestrings vs String?

John Goerzen jgoerzen at complete.org
Mon Feb 2 17:58:28 EST 2009


Marc Weber wrote:
> A lot of people are suggesting using Bytestrings for performance,
> strictness whatsoever reasons.
> 
> However how well do they talk to other libraries?
> 
> One I've in mind is hslogger right now.
> 
> Should hslogger be implemented using Strings or Bytestrings ?
> 
> Should there be two versions?
> 
> hslogger-bytestring and hslogger-string?
> 
> Or would it be better to implement one String class which can cope
> with everthing (performance will drop, won't it?)

Not necessarily.  hslogger could easily accept both, and deal with it
appropriately under the hood.  If whatever it prefers under the hood is
supplied to it, I don't see any reason that performance would suffer.

I very much suspect though that you would not likely see a measurable
performance difference either way with hslogger in real-world situations.

-- John


More information about the Haskell-Cafe mailing list