pickle faster than cPickle with numeric data?
The (binary representation of) the numeric data of an ndarray
is pickled as one long string. It appears that cPickle
is indeed much slower than pickle
in unpickling large strings from protocol 0 files. Why? My guess is that pickle
makes use of well-tuned string algorithms from the standard library and cPickle
has fallen behind.
The observation above is from playing with Python 2.7. Python 3.3, which uses a C extension automatically, is faster than either module on Python 2.7, so apparently the issue has been fixed.