Announcing jsonlib2 1.5 - the simplejson release
I've just revved jsonlib2, the C-based json parser used at metaweb for freebase.com. Compared with simplejson, my initial tests have it between 21 and 25 times faster for loads() and around 10x faster for dumps()
For those of you who have never used jsonlib/jsonlib2, all you have to know is that with this version, jsonlib2 is much more compatible with simplejson/json. Got a ways to go but for most applications it should be a drop-in replacement.
This is the first C Python extension I've ever written, and I actually inherited most of the code when I forked jsonlib because of differences with the author. This means I'm very interested in patches/ critiques/etc.
For those using jsonlib or jsonlib2:
Version 1.5 is a big API change - loads() and dumps() are now almost completely compatible with simplejson's loads() and dumps() - so it really should be a drop-in replacement. Here are a few things that have been possible with simplejson, but not with jsonlib2:
1) looser enforcement of json spec - allowing stuff like:
2) full support for Infinity, NaN, in both dumping AND parsing, by default:
I've actually imported the simplejson unit tests, and this library passes 26 of 32 tests, and most failures are just due to the fact that jsonlib2 prefers to output in utf8 rather than unicode, for faster output from a web server.