One of the biggest wins to date, use PyList_Append directly.
Our primary data structure is a List, so optimizing this case helps a lot. The main win is avoiding all of the generic function calls to append items to the current list.
Note that if we required Pyrex 0.9.8+ we could use: cdef list result result = [] result.append() and wouldn't have to define the PyList_Append functionality manually.