Profiling a pyopengl application I have been developing I obtained this results:


   ncalls  tottime  percall  cumtime  percall filename:lineno(function)

   213189   11.436    0.000   26.370    0.000 globjects.py:27(render)

  2145235    6.653    0.000   12.704    0.000 error.py:162(glCheckError)

  2144179    6.050    0.000    6.050    0.000 win32.py:72(safeGetError)


Where render is the function that does the main work of the app. As you can see, error checking takes almost one half of the real work time. I think it could be a good idea to be able to disable error checking once you know your code works ok.


After Reading http://pyopengl.sourceforge.net/ctypes/using.html, I tried this:


from OpenGL import error
def foobar(): pass



But there is no gain in performance.