5 ms·
(c)pickle uses a string protocol by default which is the most portable (even across Python versions and platforms). You need to specify another protocol version
by olt 16y ago
(c)pickle uses a string protocol by default which is the most portable (even across Python versions and platforms). You need to specify another protocol version for best performance. See http://docs.python.org/library/pickle.html#data-stream-format http://docs.python.org/library/pickle.html#data-stream-forma...
The times should be similar to lwpb then.
Edit2: Oh, and for JSON you should use http://pypi.python.org/pypi/simplejson http://pypi.python.org/pypi/simplejson
- sigil 16y agoYup, simplejson is much faster than the standard json. JSON 3.56521892548 SimpleJSON 0.727998971939 Protocol Buffer (fast) 0.38397192955 Protocol Buffer (standard) 4.86640501022 Protocol Buffer (lwpb) 0.323328971863 cPickle 0.811990976334
- indigoviolet 16y agoI think you'll find py-yajl to be faster than any of the other Python JSON modules: https://github.com/rtyler/py-yajl https://github.com/rtyler/py-yajl