https://github.com/jsonpickle/jsonpickle/commit/0b97652e4102...
jsonpickle: Remove cjson support
"First, please don't use cjson for anything. It's got multiple bugs and misfeatures, and is generally unsuited for anything except impressive benchmarks. It was easier to write my own library, from scratch, than try to fix cjson."
-- John Millikin, author of jsonlib
http://news.ycombinator.com/item?id=529104
http://metaoptimize.com/blog/2009/03/22/fast-deserialization...
$ python -mtimeit -s "from json import dumps;
d = {
'foo': 'bar',
'food': 'barf',
'good': 'bars',
'dood': 'wheres your car?',
'wheres your car': 'dude?',
}
" "dumps(d)"
100000 loops, best of 3: 6.89 usec per loop
$ python -mtimeit -s "from cPickle import dumps;
d = {
'foo': 'bar',
'food': 'barf',
'good': 'bars',
'dood': 'wheres your car?',
'wheres your car': 'dude?',
}
" "dumps(d)"
100000 loops, best of 3: 7.78 usec per loop
So `json` seems faster than `cPickle`. Right? Wrong!: $ python -mtimeit -s "from cPickle import dumps;
d = {
'foo': 'bar',
'food': 'barf',
'good': 'bars',
'dood': 'wheres your car?',
'wheres your car': 'dude?',
}
" "dumps(d, -1)"
100000 loops, best of 3: 3.59 usec per loopI am going to do some follow up tests to cover the advice I got here. I will include this, tnetstrings and decodes too.
Python 2.5 -- including pickle's (faster) bin mode
Starting simplejson dumps...
done: 31.7636611462
Starting cjson encode...
done: 3.80062890053
Starting pickle dumps...
done: 10.4873199463
Starting pickle dumps (protocol=-1 -- force HIGHEST_PROTOCOL)...
done: 5.98110699654
Starting simplejson loads...
done: 138.709590197
Starting cjson decode...
done: 1.85300803185
Starting pickle loads...
done: 5.24735999107
Starting pickle loads (protocol=-1 -- force HIGHEST_PROTOCOL)...
done: 3.66428518295