pickle alternative

simonwittber at gmail.com simonwittber at gmail.com
Wed Jun 1 02:08:48 EDT 2005


> I can't reproduce your large times for marshal.dumps.  Could you
> post your test code?


Certainly:

import sencode
import marshal
import time

value = [r for r in xrange(1000000)] +
[{1:2,3:4,5:6},{"simon":"wittber"}]

t = time.clock()
x = marshal.dumps(value)
print "marshal enc T:", time.clock() - t

t = time.clock()
x = marshal.loads(x)
print "marshal dec T:", time.clock() - t

t = time.clock()
x = sencode.dumps(value)
print "sencode enc T:", time.clock() - t
t = time.clock()
x = sencode.loads(x)
print "sencode dec T:", time.clock() - t




More information about the Python-list mailing list