[Numpy-discussion] Numpy and PEP 343

Tim Hochberg tim.hochberg at cox.net
Fri Mar 3 09:39:03 CST 2006


Travis Oliphant wrote:

> David M. Cooke wrote:
>
>> I couldn't leave it at that :-), so I wrote my bytecode idea up.
>>
>>  
>>
> I like what you've done.  It makes me wonder what could be done with 
> just a Python-level solution (that might be easier to generalize to 
> more data-types and operators).

I tried hand coding stuff at the pure Python level to see how close I 
could come to David's results. I performed the operations in chunks 
(larger chunks than he did so that Python overhead didn't kill me) For 
the second case he presents (2*a+3*b), I managed to get a 70% speedup. 
While not negligible, it's a far cry from the 180% speedup I saw with 
David's code for the same result. So while doing things at the Python 
level would certainly be easier, the payoff isn't likely to be nearly as 
big.

> You've definitely given us all some great stuff to play with.

Indeed.







More information about the Numpy-discussion mailing list