[Python-Dev] Status of json (simplejson) in cpython
Antoine Pitrou
solipsis at pitrou.net
Sat Apr 16 19:27:36 CEST 2011
On Sat, 16 Apr 2011 16:47:49 +0000 (UTC)
Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
>
> > What you're proposing doesn't address the question of who is going to
> > do the ongoing maintenance.
>
> I agree, my suggestion is orthogonal to the question of who maintains stdlib
> json.
No, that's not what I'm talking about. The json module *is* maintained
(take a look at "hg log"), even though it may be less active than
simplejson (but simplejson doesn't receive many changes either).
I am talking about maintenance of the "shared codebase" you are talking
about. Mandating a single codebase between two different languages
(Python 2 and Python 3) and two different libraries (json and
simplejson) comes at a high maintenance cost, and it's not obvious in
your proposal who will bear that cost in the long run (you?). It is not
a one-time cost, but an ongoing one.
> Bob has said he isn't interested in Python 3, but he has said that "if
> someone contributes the code to make simplejson work in Python 3 I'm willing
> to apply the patches run the tests against any future changes."
I can't speak for Bob, but this assumes the patches are not invasive
and don't degrade performance. It's not obvious that will be the case.
> Bob made a comment in passing that simplejson (Python) is about as fast as
> stdlib json (C extension), on 2.x.
I think Bob tested with an outdated version of the stdlib json module
(2.6 or 2.7, perhaps). In my latest measurements, the 3.2 json C module
is as fast as the C simplejson module, the only difference being in
parsing of numbers, which is addressed in
http://bugs.python.org/issue11856
> That may or may not prove to be the case on
> 3.x, but at least it is now possible to run simplejson on 3.x (Python only, so
> far) to make a comparison.
Feel free to share your numbers.
Regards
Antoine.
More information about the Python-Dev
mailing list