logo       

Re: Pyrex method 10x slower than Python, any hints why?: msg#00005

python.pyrex

Subject: Re: Pyrex method 10x slower than Python, any hints why?

On Fri, Jun 02, 2006 at 01:03:35PM +1000, John Machin wrote:
[...]
> >
> >Perhaps the difference is that Python's eval loop special cases arithmetic
> >operations on numeric types quite heavily, but the same loop in Pyrex has to
> >resort to function calls?
> >
>
> Huh? AFAICT, all of the operations on numeric types in the quoted code
> are being done in cdef'ed variables i, sum and cost. There is *some*
> overhead caused by converting i to a Python int, and by getting the
> result of the function call (Python float) into cost.

Sorry, that was a dumb thinko! I was getting muddled with comments elsewhere
that you also tried pyrex without the cdefs.

-Andrew.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise