[Pyrex] possible bug in Pyrex

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Feb 26 00:29:16 CET 2010


Stefan Behnel wrote:

> As a general rule of thumb, the code generated by Cython is quite a bit
> longer and substantially faster than the corresponding Pyrex code.

Be careful you're not comparing apples with oranges here,
though. Pyrex is capable of generating quite efficient code
for many things, it's just not as automatic as Cython.

For example, I gather that Cython will generate a test
for a list object and index it using list-specific calls
in that case.

Recent versions of Pyrex will also use list-specific calls,
but only if you declare it as a list. Theoretically this
should be even faster, because there is no run-time test
involved.

-- 
Greg





More information about the Pyrex mailing list