[Cython] Draft for compile-time calculation inliner

Stefan Behnel stefan_ml at behnel.de
Sat Mar 15 22:23:25 CET 2008


Hi,

Robert Bradshaw wrote:
> I think inlining
> (which one can explicitly request in the C output) and loop unrolling  
> are well handled by GCC and is probably best handled at this  
> level for most things (for now at least).

In general, yes. There is one thing that GCC can't do, however, and that's
dropping the INCREF/DECREF of parameters in an inlined function. So,
especially for very short functions (where inlining makes the biggest
difference), having Cython do the inlining would actually result in a
performance gain.

But I agree that that's neither low-enough hanging fruit nor such a major gain
that it's worth doing it right now...

Stefan



More information about the Cython-dev mailing list