[Numpy-discussion] Numpy and PEP 343

David M. Cooke cookedm at physics.mcmaster.ca
Fri Mar 3 14:45:02 CST 2006


Tim Hochberg <tim.hochberg at cox.net> writes:
>>
> We may want to reconsider this at least partially. I tried
> implementing a few 1-argument functions two way. First as a table
> lookup and second using a dedicated opcode. The first gave me a
> speedup of almost 60%, but the latter gave me a speedup of 100%. The
> difference suprised me, but I suspect it's do to the fact that the x86
> supports some functions directly, so the function call gets optimized
> away for sin and cos just as it does for +-*/. That implies that some
> functions should get there own opcodes, while others are not worthy.

Yeah, I was going to stare at the assembly output from gcc before
deciding.

Note that some functions that are supported directly by the CPU may
still be a function call because they aren't good enough.

-- 
|>|\/|<
/--------------------------------------------------------------------------\
|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca




More information about the Numpy-discussion mailing list