Major OpenGL performance hit using Python?

TheDustbustr thedustbustr at aol.com
Sat May 10 21:33:22 EDT 2003


I've been messing around with an OpenGL terrain renderer in Python.  Without
texturing, coloring or lighting, I get 119 frames per second (roughly 2000
triangles, no frustum culling or LOD).  Compare this to Thatcher Ulrich's
quadtree demo (written in C++) - Using this to benchmark, I get about 660 FPS
(thousands of triangles frustrum culled and LOD'ed down to about 2000, with
texturing and texture lighting).  Both my renderer and Ulrich's use
glVertexPointer / glDrawElements to submit vertices to OGL.  Obviously, no
matter how rough the benchmark comparison, my little renderer is running much
slower.

Is it possible that this performance hit is attributed to Python being slow, or
am I missing optimizations?  If the former is true, I need to switch to C++
(however much I dread doing such), because I plan on turning this into a game.

I'm using an event based engine with Pygame (so any handler called results in
several functions being called, I guess that produces overhead...)  Were I to
switch to C++, I would implement an event based system in that language.

Thanks, Dustin




More information about the Python-list mailing list