[Haskell-cafe] Re: String vs ByteString
johan.tibell at gmail.com
Tue Aug 17 05:06:30 EDT 2010
On Tue, Aug 17, 2010 at 10:34 AM, Bulat Ziganshin <bulat.ziganshin at gmail.com
> > It's not clear to me that using UTF-16 internally does make
> > Data.Text noticeably slower.
> not slower but require 2x more memory. speed is the same since
> Unicode contains 2^20 codepoints
Yes, in theory a program could use as much as 2x the memory. That being
said, most programs don't hold that much text data in memory at any given
point so that might be 2x of a small number. One experiment  found it
difficult to show any difference in memory usage at all in Trac when
switching Python's internal representation from UCS2 to UCS4.
So it's not clear to me that using UTF-16 makes the program noticeably
slower or use more memory on a real program.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe