|
Re: Pyrex method 10x slower than Python, any hints why?: msg#00005python.pyrex
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> |
|---|---|---|
| Previous by Date: | Re: Pyrex method 10x slower than Python, any hints why?: 00005, John Machin |
|---|---|
| Next by Date: | Re: Pyrex method 10x slower than Python, any hints why?: 00005, John Machin |
| Previous by Thread: | Re: Pyrex method 10x slower than Python, any hints why?i: 00005, John Machin |
| Next by Thread: | Re: Pyrex method 10x slower than Python, any hints why?: 00005, John Machin |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |