[Haskell-beginners] Performance problem with Haskell/OpenGL/GLFW
sarnesjo at gmail.com
Fri Mar 8 13:25:34 CET 2013
My first post here. :)
I have a curious performance problem with a Haskell/OpenGL/GLFW
program that I just can't figure out.
The program's CPU usage is quite high in general, and increases with
the number of pixels redrawn per frame. It uses OpenGL 3.2, does most
of its work on the GPU, and should do a constant amount of work per
frame on the CPU, so this makes little sense.
I've created a smaller program (still 91 lines, though), which renders
a single triangle, but still reproduces this problem. If I make the
triangle smaller (by editing vertexData), CPU usage goes down, and if
I make it bigger, CPU usage goes up. 
I've also created a C program which does the same thing (as far as
possible), but which does not exhibit this problem. CPU usage is far
lower, and stays constant regardless of the number of pixels redrawns
per frame. 
The library functions I use (from OpenGLRaw-184.108.40.206 and
GLFW-b-0.1.0.5) are only thin wrappers around their C counterparts, so
I strongly believe the problem is in my program.
More information about the Beginners