Python in game development?

Martijn Faassen m.faassen at vet.uu.nl
Thu Jul 20 07:58:21 EDT 2000


In comp.lang.python Moritz Voss <nospam at buzzoff.com> wrote:

> "Martijn Faassen" <m.faassen at vet.uu.nl> schrieb im Newsbeitrag
> news:8l4isr$l58$2 at newshost.accu.uu.nl...
[snip]
>> So no, you don't have to do all that; Python already includes a compiler
>> and interpreter that can be embedded into your game.

> HOW FAST ARE THESE? <drool>

Python's not amazingly fast by itself.

Note that the speed of the compiler doesn't matter much; it's near
instantaneous, but since it outputs bytecodes and you can use those,
the speed of the interpreter is what really matters, and the interpreter
isn't too fast.

Python is a very dynamic language, and its nature makes some optimizations
rather hard to do.  That said, Python's basic built-ins like lists and
hashes, as well as lots of its standard library is implemented in C.

There have been good results with offloading anything that takes time
onto C, and integrating this with a higher-level Python interface so
the core components can be scripted easily. Since the lore is that 90% of
the time is spent in 10% of the code or somesuch, you just need to do
10% of the code in C. :)

>From a game programming perspective, you can probably consider Python to
be dirt-slow, though. The trade-off is a lot of power for speed, but
that power can help you gain back speed because you can be a lot smarter.

Regards,

Martijn
-- 
History of the 20th Century: WW1, WW2, WW3?
No, WWW -- Could we be going in the right direction?



More information about the Python-list mailing list