Slow Python - what can be done?

Ralf Muschall ralf at tecont.de
Fri Mar 19 18:15:55 EST 2004


sewall93 at rocknroll.umcs.maine.edu (Jason) writes:

> Thanks for the help - I wasn't aware of the profilers avilable for
> Python.

You might abuse complex numbers for points (the lisp faq recommends
doing this), maybe it speeds things up.  You might even save time (I
did not try this, but hardware operations might be cheaper than Python
procedure calls) by doing complex products and ignoring the imaginary
part of the result just to get quickly at stuff like
p1.x*p2.x-p1.y*p2.y.

If you come from the lisp world anyway, you might try STk or stklos
(schemes with OO and Tk (or GTK) bindings).

Ralf
-- 
GS d->? s:++>+++ a+ C++++ UL+++ UH++ P++ L++ E+++ W- N++ o-- K- w--- !O M- V-
PS+>++ PE Y+>++ PGP+ !t !5 !X !R !tv  b+++ DI+++ D?  G+ e++++ h+ r? y?



More information about the Python-list mailing list