[Python-Dev] The memo of pickle

Jeremy Hylton jeremy@alum.mit.edu
Fri, 9 Aug 2002 08:28:01 -0400


One of the things I mentioned on the c.l.py thread is the
Py_BEGIN_ALLOW_THREADS and Py_END_ALLOW_THREADS calls around every
fwrite() call.  I looked into it, using Penrose's test case, and found
that the locking alone added 25% overhead.  I expect the layer or two
of C function calls above fwrite() add overhead.  I also expect that
calling fwrite() repeatedly for very small strings is inefficient.

If I were to suggest a cPickle project, it would be an efficient
internal buffering scheme.

Jeremy