On my informal benchmark of JSON parsing speed, simplejson was 27x faster than json.
The idiom I've been using is:
try:
import simplejson as json
except ImportError:
import jsonOn my informal benchmark of JSON parsing speed, simplejson was 27x faster than json.
The idiom I've been using is:
try:
import simplejson as json
except ImportError:
import jsonIt is the externally maintained version of the json library contained in Python 2.6, but maintains compatibility with Python 2.5 and (currently) has significant performance advantages, even without using the optional C extension for speedups. </quote> http://simplejson.readthedocs.org/en/latest/index.html
I see there are performance patches to stdlib's json since 2.6: http://hg.python.org/cpython/search/?rev=_json.c&revcoun...
An order of magnitude difference might be an issue with your python installation.
On my machine version from 2.6 (1.9) is 15 times slower than from 2.7 (2.0.9). Though simplejson (2.2.1) is still faster on both 40 and 2 times correspondingly for .loads() timeline.js from the example as measured by:
% timeit json.loads(timeline_text)
it seems that C speedups available on both versions: python -v -c'import json' 2>&1 | grep _json.so
python -c'import json.decoder as d; print d.scanstring'
Is your python version old? Otherwise it is worth to open issues at http://bugs.python.org to merge speed improvements and at https://github.com/simplejson/simplejson/issues to mention in the docs and on http://pypi.python.org/pypi/simplejson more clearly that Python 2.7+ stdlib's version is also slower.