fastmath library?

Alex Martelli aleaxit at yahoo.com
Fri Nov 17 18:13:46 CET 2000


"Michael Hudson" <mwh21 at cam.ac.uk> wrote in message
news:m3g0kqr9mr.fsf at atrus.jesus.cam.ac.uk...
    [snip]
> Hmm... you didn't post your dummy function!  Anyway, I bet actually

Oops, sorry, it was

def dummy(somefloat):
    return somefloat

> computing the sin of the argument is still dwarfed by the function
> call mechanism,

Not exactly -- calling math.sin is more than twice as slow as
calling dummy.  That's not "swamping" in my book...

> so even if you have a fast C memoization/lookup thingy
> then you aren't likely to save even 50% of the call cost.  I could be

Definitely not more than that (on a Pentium-II or similar).

> wrong, though (and am more likely to be on machines without an FPU).

Sure, everything changes if you don't have an FPU.


Alex






More information about the Python-list mailing list