Using cPickle Instead of Python's marshal Module
Sunday August 26, 2007
Python's
In general,
If speed is of the essence, however, you should consider
marshal module is, as the Python documentation states, not a general persistence module. It is not meant for saving sessional values but for working with the pseudo-compiled code of compiled Python programs (*.pyc).
In general,
pickle should be used instead of marshal. The former is more flexible; the latter is faster. One reason for this speed is because marshal does not have the security of pickle. It is not secured against malicious or badly formed data.
If speed is of the essence, however, you should consider
cPickle. Written in C, cPickle has much the same functionality as pickle but is around 1000 times faster.