Python very slow on the Sharp Zaurus - any idea why?

Alexandre Courbot alexandrecourbot at linuxgames.com
Mon Jul 22 17:21:53 EDT 2002


> [Anders J. Munch]
> > Python uses floating point to check for integer arithmetic overflow.
> 
> [Bernhard Herzog]
> > Not any more. This change was introduced in 2.1 IIRC.
> 
> This is complicated.  First, scratch "integer arithmetic overflow",
> because it's too broad.  Only integer multiplication is relevant here.
> 
> Python used to use float arithmetic to detect int mult overflow, but
> that didn't work correctly on some 64-bit boxes.
> 
> It got replaced by over 100(!) lines of all-integer int mult
> overflow-checking code, and I believe that's still in 2.1.3.
> 
> But that had an obscure endcase bug too, and it get replaced in 2.2 by
> a new float method that doesn't make unwarranted assumptions about the
> relative sizes of C longs and C doubles, and usually gets out quickly
> -- provided float arithmetic isn't pig slow.

Oh. Maybe it'd be worth to do some profiling there. I'll try to compile
it again for the Zaurus with profiling information to see where it
exactly slows down. Thanks to everybody for the many answers! :)

Alex.
-- 
http://www.gnurou.org





More information about the Python-list mailing list