[HOpenGL] GlxGears

Shawn P. Garbett listman at garbett.org
Tue Mar 16 07:02:55 EST 2004


On Tuesday 16 March 2004 2:09 am, Sven Panne wrote:
> Shawn P. Garbett wrote:
> > [...]
> > Haskell Version on my laptop, FPS = 103
> > C Version on my laptop, FPS = 192
> > [...]
>
> I just gave your example a quick try on my PC, the results do not
> differ that much for my setup (SuSE x86 Linux 8.2, 3GHz P4, NVIDIA FX
> 5900):
>
>     Haskell version: 6000 FPS
>     C version: 7165 FPS

That's even better. The actual difference isn't x2 on a fast box, but 
much closer. So for a performing box, the speed difference is quite 
acceptable given the gains of working in Haskell. Good job to the 
HOpenGL folks. 

>
> Curiously, using -O for the Haskell compilation doesn't make any
> difference. I'll take a closer look with GHC's profiler and the
> ltrace tool when I get some time.
>
> Thanks for the conversion BTW, I'd like to place this example into
> GLUT'S "Misc" example directory, with a BSD-like license. Would that
> be OK?

That was the intent of the copyright at the top. Maybe I got it wrong, 
but it's supposed to be a BSD style license. I really don't care how 
it's used, but I just wanted to show my support for the BSD code 
sharing method.

I suspect that data marshalling is most of the speed difference. As I 
understand when a program misses a frame refresh window, OpenGL put's 
it in the next frame refresh window, so the actual speed difference may 
be quite small and it occasionally misses the refresh window.

Shawn



More information about the HOpenGL mailing list