[Cython] Supporting cython.operator in C

Jeroen Demeyer jdemeyer at cage.ugent.be
Thu Jun 2 03:57:46 EDT 2016


On 2016-06-02 05:43, Robert Bradshaw wrote:
>> 2. "x || y" because Cython's "x or y" generates complicated code which isn't
>> optimized as well as "x || y".
>
> I just tried using gcc -O3 and the resulting assembly is identical.

Well, that would depend on what x and y are.

A very concrete example:

"if isinstance(x, (int,long))", which is parsed as "if PyInt_Check(x) or 
PyLong_Check(x)" is slightly slower than "if PyInt_Check(x) || 
PyLong_Check(x)".


More information about the cython-devel mailing list