[Twisted-Python] cBanana diffs

Bruce Mitchener bruce at cubik.org
Mon Jul 8 04:56:04 EDT 2002


I've made a couple of local changes to cBanana to look at improving the 
performance of it some.

The diff is available from:
   http://day.cubik.org/~bruce/spread.diff

The change from the malloc/memcpy/free sequence to a realloc should be 
pretty clear.

The remainder of the changes are intended to let us allocate the python 
list objects in the correct size (since we know that) and to then use 
PyList_SET_ITEM() rather than PyList_Append().  In theory, that should 
help, in practice, it didn't much on simple tests.

One thing that was taking a while in simple runs was the handling of 
LONGINT and LONGNEG values (which call back into Python rather than 
using C code).  I've not yet optimized that at all as I don't yet have a 
good enough understanding.

I'll also run this new cBanana.c under valgrind or Purify this week to 
make sure that I didn't introduce any memory leaks.

Comments and suggestions are welcome.

  - Bruce





More information about the Twisted-Python mailing list