[Haskell-cafe] Optimizing performance problems with Aeson rendering large Text arrays

Bas van Dijk v.dijk.bas at gmail.com
Fri Feb 1 14:44:57 CET 2013


On Feb 1, 2013 1:15 PM, "Oliver Charles" <ollie at ocharles.org.uk> wrote:
>
> Urgh, the formatting got totally destroyed in sending, I think. If so,
here's a paste of my email as I intended it to be sent:
>
> http://hpaste.org/81648
>
> Sorry about that!
> - Ocharles
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

If I make a special case for text based UUIDs in aeson:

data Value = ... | UUID Text | ...

Data.Aeson.Encode.fromValue (UUID s) = singleton '"' <> fromText s <>
singleton '"'

Then encoding time improves by 20%.

So a big part of the time is spent encoding the UUID strings.

Bas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130201/27a1d045/attachment.htm>


More information about the Haskell-Cafe mailing list