On Nov 20, 2009, at 10:44 AM, Stefan Behnel wrote: > Hi, > > the current generator CEP proposes to use computed goto's, as > described > here, for example: > > http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Labels-as-Values.html > > However, from a web search, it seems that they are not a standard C > feature > and therefore not completely portable, which is the reasons why > CPython 3.1 > only enables their use optionally for the interpreter core (ceval). > Here is > an example for a compiler that doesn't seem to support them: > > http://code.google.com/p/unladen-swallow/issues/detail?id=22 > > It's one thing to provide a build time option for a performance > enhancement > (as CPython 3.1 does), but it's a different beast to make a language > feature depend on a non-standard compiler feature (as the CEP > suggests). > > I wasn't able to find a list of compilers that support this, so I > can't say > how many compilers we'd lock out. Any ideas? Pointers? Opinions?
How much of a performance lost are we talking here? If we're already unpacking python arguments, passing through virtual functions, and returning object, having a list of gotos in a switch statement will probably not even be measurably slower (though worth checking). That would seem sufficient for a first pass, at least until we have cdef- level calling of generators. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
