From: Pete S. <pe...@vi...> - 2000-09-14 00:07:32
|
i've been experimenting with Python2C to see if there's any chance for 'free' optimizations. sadly, it looks like this isn't going to be the tool that helps many people. all these results gotten from windows NT (using SDL's GDI driver) i expect similar results across all platforms and drivers. This was also all done with python 1.5.2. (i'm not sure of python2c's compatibility with newer versions) first, i tried python2c out on the stars examples that comes with python ("sf"). the "C" version actually ended up about 2 fps slower than the python version. i doublechecked things a couple times. the python version ran about 31fps, the python2c version ran at 29fps. not too encouraging there. i decided to try something a little more "sprite-based". i tried getting it to work with my pyaliens demo, but python2c was getting internal errors while translating it, doh. i also tried it on David Clark's earlier pyaliens-1.1, and while i did get it compiled, the code gave me an "Interger Overflow Error" right after starting up. needless to say, python2c doesn't look like it handle's all python code. just for sanity, i tried running python2c on "pystone", a python runtime benchmarker. the python2c compiled code ran about 1.3 times faster. (so it can speed up some code, heh) (the gurus on comp.lang.python back this up once in awhile stating that compiled python code won't gain that much performance in most situations. it seems that's the case) anyways, this seems to support the theory that most of your game's runtime is spent inside the SDL library anyways. so using SDL in python is not losing a whole lot to using SDL in C. (woohoo!) |