mark florisson, 25.01.2012 12:36: > On 25 January 2012 11:32, mark florisson wrote: >> On 25 January 2012 11:24, Vitja Makarov <[email protected]> wrote: >>> I'm thinking about implementing "conditional inlining": depending on >>> what function actually is it'll make direct call to C function or >>> PyObject_Call(). >> >> Sounds like a good idea. Any idea how much faster that can be? > > Hm, probably about an order of magnitude for a noop function (simple > test of cdef vs def call).
Easily, yes. It avoids all the argument type conversion and packing/unpacking. That's a huge overhead compared to a straight conditional C function call which the C compiler could even inline, or the CPU could at least keep in its branch prediction cache and optimise its pipeline for. Stefan _______________________________________________ cython-devel mailing list [email protected] http://mail.python.org/mailman/listinfo/cython-devel
