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

Alexandre Courbot alexandrecourbot at linuxgames.com
Sun Jul 21 05:42:05 EDT 2002


Hello everybody,

I have just ported the game I'm working on to the Sharp Zaurus (206 Mhz
StrongArm, Linux based handheld). This game links to the Python library
to embed the Python interpreter, which is used as the game internal
scripting language. However, performances are far behind what I'd have
expected.

On a classic PC, there is no noticeable overhead because of the Python
scripts and the gfx operations takes most of the CPU. On the Zaurus
however, it's all the contrary: the game is so slow that it is totally
unplayable. And when I disable all Python scripting, it's very smooth. I
don't understand why it is becoming so slow on the Arm.

Note that the Arm doesn't have any floating point unit, and that the
floating point operations are all emulated. But I never use any floating
point arithmetic in my game or in my Python scripts. Note also that I
had to cross-compile the Python library myself from Python 2.2 sources,
as there is no lightweight Python distribution for the Arm. But I don't
get what's wrong. Does Python use floating point arithmetic internally?
Is there something else I missed?

My scripts are short schedules that update a character state or take a
decision like where to move, for instance. They are quite short, and are
run by the game engine at the rate of about 70 times per second. If you
want so, I can send one here for analysis.

Any help, comment or pointer would be greatly appreciated - moreover
Python is quite popular on the Zaurus, as it allows to build GUI
applications very easily, so it's surely worth to try to speed it up!

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





More information about the Python-list mailing list