[Haskell-cafe] Google Summer of Code: BlazeHTML RFC

Ivan Miljenovic ivan.miljenovic at gmail.com
Thu May 27 04:40:49 EDT 2010


On 27 May 2010 18:33, Michael Snoyman <michael at snoyman.com> wrote:
> I don't do any string concatenation (look closely), I was very careful to
> avoid it. I tried with lazy text as well: it was slower. This isn't
> surprising, since lazy text- under the surface- is just a list of strict
> text. And the benchmark itself already has a lazy list of strict text. Using
> lazy text would just be adding a layer of wrapping.
> I don't know what you mean by "explicitly using Text values"; you mean
> calling pack manually? That's really all that OverloadedStrings does.
> You can try out lots of different variants on that benchmark. I did that
> already, and found this to be the fastest version.

Fair enough.  Now that I think about it, I recall once trying to have
pretty generate Text values rather than String for graphviz (by using
fullRender, so it was still using String under the hood until it came
time to render) and it too was much slower than String (unfortunately,
I didn't record a patch with these changes so I can't just go back and
play with it anymore as I reverted them all :s).

Maybe Bryan can chime in with some best-practices for using Text?

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list