[Python-Dev] FAT Python (lack of) performance
Stephen J. Turnbull
stephen at xemacs.org
Tue Jan 26 12:51:54 EST 2016
Terry Reedy writes:
> On 1/26/2016 12:02 AM, INADA Naoki wrote:
>
> > People use same algorithm on every language when compares base language
> > performance [1].
>
> The python code is NOT using the same algorithm. The proof is that the
> Python function will return the correct value for, say fib(50) while
> most if not all the other versions will not.
True, but that's not a reasonable criterion for "same algorithm" in
this context. Naoki's application ("base language performance"
benchmarking) requires fib(n) only for n < 40, and run it in a loop
100 times if you want 2 more decimal places of precision ("40" is
appropriate for an implementation with 32-bit ints). On that
restricted domain the algorithm *is* the same.
If you want to argue that the bigger domain is a better one to use for
evaluating programming languages, be our guest. But then you're
comparing apples (speed) to oranges (domain), and Naoki (or the
Japanese benchmarkers) can argue that a smaller, more risky, domain is
covered by "consenting adults" -- if you know there's a risk, you need
to write code to deal with it, but if you know there isn't, you
shouldn't have to accept lower performance.
Obviously, I don't think that's an appropriate tradeoff myself, but
that's based on "IMHO" not "comparison is invalid because algorithms
differ".
More information about the Python-Dev
mailing list