I've learned something today. The cPickle
module in Python can be boosted with very little effort. I've also learnt that there's something even faster than a hotted 'cPickle': marshal
.
The code in question is the CheckoutableTemplates which saves information about the state of templates in Zope to a file on the file system. The first thing I did was to insert a little timer which looked something like this:
def write2config(...):
t0=time()
result = _write2configPickle(...)
t1=time()-t0
debug("_write2configPickle() took %s seconds"%t1)
return result