[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] this week in dobb's python-url



> Speaking of speed, have you thought about forking a stackless
> python version of pygame?  Just a thought

early on i tried many things to see if pygame code could be
optimized. i did all my testing with the aliens demo, so it
is semi-representable for real game code.

i tried many things, but nothing gave a real noticeable speed
increase. some things tipped in a 1fps boost, but nothing worth
the costs.

i tried stackless, which didn't speed anything up, not a real
surprise as that is not really the goal of stackless python. 
although i've thought the microthreads in stackless python
could be a great tool for managing game object logic.

i also tried the python2c converter. this takes python code and
turns it into c code (which looks like python C extension code).
in the end this still does all the same memory management as
normal python, but it eliminates the python bytecode emulation.
this also gave no speed increase.

i do think in more logic intensive code the python2c would have
shown a difference, but in code that is dependent on SDL it will
obviously be the same.

before solarwolf 1.0 was released i spent some time with the 
python profiler to see where the bottlenecks were. i didn't
find any real surprises in the game code. a lot of time spent
in the Surface.blit() and display.update() calls.

eek, i found my old old post for testing python2c, looks worse
than i thought.
http://www.geocrawler.com/archives/3/2768/2000/9/0/4339974/




____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org