Optimization tips?

30 views
Skip to first unread message

Christopher Howard

unread,
Dec 7, 2012, 4:03:49 AM12/7/12
to haskel...@googlegroups.com
Hi - question for someone pretty familiar with the gloss code: what are
the most fruitful areas for optimization, as far working with gloss?
What sort of factors tend to be the most significant in terms of
processing power, or do the most to prevent lag? E.g., number of objects
you are attempted to draw on the screen? Size/resolution of the bitmaps
being painted? Amount of rotation / resizing that is done? Any other
useful optimization-related tips or insights?

I'm coding a 2D arcade game, and I'm developing on low-end hardware (no
hardware graphics acceleration). When I get anything more than about
eight bitmaps and fifteen shapes on the screen at once, everything gets
really jittery, like the frame rate has dropped real low. Not saying of
course that my simulation math couldn't use a lot of optimization, but
I'm inclined to look to the graphics aspect first.

--
frigidcode.com

signature.asc

Ben Lippmeier

unread,
Dec 10, 2012, 1:25:36 AM12/10/12
to haskel...@googlegroups.com, Christopher Howard
I haven't tried running Gloss on low-end hardware before, just desktop machines.

For raw rendering, performance would depend on how good your software OpenGL implementation is. For example, if you draw a rectangular image on the screen without rotation or scaling this should just be a memory move without any need to perform floating-point operations. However, if there is a rotation or scale transform applied then you have to do proper matrix multiplications etc, and you need the floating-point unit.

Another potential problem is that the Gloss frame rate control code isn't very good. If you're using the 'simulate' wrapper and have specified a fixed simulation rate (in steps/second), but your simulation loop is too slow for the processor to keep up, then the code will behave badly. It will start dropping frames in an attempt to reduce the workload, but if it still can't keep up it'll end up dropping *all* frames and your program will grind to a halt..

Ben.




Reply all
Reply to author
Forward
0 new messages