[Web-SIG] Time a for JSON parser in the standard library?

Bob Ippolito bob at redivi.com
Thu Mar 20 23:03:37 CET 2008


On Thu, Mar 20, 2008 at 1:37 PM, Deron Meranda <deron.meranda at gmail.com> wrote:
> On Sun, Mar 16, 2008 at 7:18 PM, Guido van Rossum <guido at python.org> wrote:
>  >  I'm reading Alan's post as saying that he has a competing implementation.
>
>  Yes, there are several JSON implementation now, some
>  better than others.
>
>  I finally sat down and put the five or so top JSON libraries
>  to the test so we can all see what's what.  I've put everything
>  in a report here:
>
>  http://deron.meranda.us/python/comparing_json_modules/
>
>  I have tried to be very rigorous.  There's probably mistakes
>  in there, so let me know if anybody finds any.  Also if any
>  of you module authors update your code and want me to
>  re-do the tests against a newer version let me know.

This is very cool, but it's not reproducible. If you published the
code that you used then it would help everyone out considerably. For
example, with simplejson 1.7.5 I'm unable to reproduce the problems
you're experiencing with
http://deron.meranda.us/python/comparing_json_modules/strings in Table
1 (other than UserString of course). I've tried this both on 32-bit
UCS-2 python (OS X) as well as 64-bit UCS4 python (x86-64 linux) and I
get correct output. I'm still looking through the rest of the tests,
so that might not be the only supposed problem that I'm unable to
reproduce.

>  I do think though that if this is targeted for Python 3, that
>  none of the modules really works well.  We should really
>  design an interface that uses the bytes type rather
>  than str for pushing around encoded JSON data.

I can certainly agree with that. The scope of the changes wouldn't be
that big though, at least for simplejson's default behavior (escape
everything to ASCII).

-bob


More information about the Web-SIG mailing list