OOmadness
[58] OOmadness / Cerealizer / Benchmark
Cerealizer : Benchmark - Download - Reference documentation
Jiba
I've performed a little benchmark comparing the performances of Cerealizer, cPickle, Jelly + Banana and Jelly + cBanana (from Twisted Matrix) for serializing a list of 2000 objects defined as following :
class O:
  def __init__(self):
    self.x = 1
    self.s = "jiba"
    self.o = None
with self.o referring another 0 object in the list.

The results are (with Psyco) :


With old-style classes: cerealizer dumps in 0.0619530677795 s, 114914 bytes length loads in 0.0313038825989 s

cPickle dumps in 0.0301840305328 s, 116356 bytes length loads in 0.023097038269 s

jelly + banana dumps in 0.168012142181 s 169729 bytes length loads in 1.82081913948 s

jelly + cBanana dumps in 0.082946062088 s 169729 bytes length loads in 0.156159877777 s

With new-style classes: cerealizer dumps in 0.0575239658356 s, 114914 bytes length loads in 0.028165102005 s

cPickle dumps in 0.07634806633 s, 116428 bytes length loads in 0.0278959274292 s

jelly + banana dumps in 0.156242132187 s 169729 bytes length (TypeError; I didn't investigate this problem yet although it is surely solvable)

jelly + cBanana dumps in 0.10772895813 s 169729 bytes length (TypeError; I didn't investigate this problem yet although it is surely solvable)


featurepicklecPickleCerealizerJelly + BananaJelly + cBanana
LanguagePythonCPythonPythonPython + C
SpeedVery slowVery fastFast; can even beat cPickle on new-style classesVery slowSlow
SecureNoYesYes
File lengthMediumMedium, roughly equivalent to pickleMedium, files seem slighly more bigger on my bench
Human-readability of filesPoorVery poorGood
Supports C-defined typesYesYesYes, although see (*)


(*) Jelly handles them, but tuples and objects in a cycle are first created as _Tuple or _Dereference objects; this works for Python classes, but not with C-defined types which expects a precise type (e.g. tuple and not _Tuple), due to static typing.
(add comment, add sub-topic, edit, archives, rss)