[Haskell-cafe] Slow Text.JSON parser
dons at galois.com
Tue Jan 13 18:42:15 EST 2009
utf8-string allows one to decode utf8 from bytestrings. It was built so
that we could decode utf8 strings at work from bytestrings :)
Enjoy! Libraries win every day of the week.
> JSON is a UNICODE format, like any modern format is today. ByteStrings
> are not going to work.
> If everybody starts yelling "ByteString" every time String performance
> is an issue, I don't see how Haskell is ever going to be a "real world
> programming language".
> On Jan 13, 2009, at 4:00 PM, Don Stewart wrote:
> >>"Levi Greenspan" <greenspan.levi at googlemail.com> writes:
> >>>Now I wonder why Text.JSON is so slow in comparison and what can be
> >>>done about it. Any ideas? Or is the test case invalid?
> >>I haven't used JSON, but at first glance, I'd blame String IO. Can't
> >>you decode from ByteString?
> >Text.JSON was never optimised for performance. It was designed for
> >JSON objects. For things above 1M I'd suggest using Data.Binary (or a
> >quick JSON encoding over bytestrings). Shouldn't be too hard to
> >-- Don
> >Haskell-Cafe mailing list
> >Haskell-Cafe at haskell.org
> Sjoerd Visscher
> sjoerd at w3future.com
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe