[Numpy-discussion] Numpy and PEP 343

Tim Hochberg tim.hochberg at cox.net
Fri Mar 3 12:13:02 CST 2006


In my local copy of numexpr, I added a few unary functions just to see 
how it would be. Pretty easy reall. I think binary functions will also 
be easy. Trinary functions (e.g., where) will be a bit harder unless we 
move to 5 byte opcodes. At present I'm not doing anything fancy like 
looking up functions in a table, I'm just giving each it's own opcodes. 
If the code gets big enough that it starts falling out of the cache, we 
might consider that, but adding opcodes is simpler.

I also fixed a couple places where constant folding seemed to be not 
completely working. Once I figure out where the sandbox is I'll upload 
the changes....

Expression: 2*a+(cos(3)+5)*sin(b)
numpy: 0.224821311088
numexpr: 0.112924547673
Speed-up of numexpr over numpy: 1.99089848683


More information about the Numpy-discussion mailing list