Hitchy Performance on HTML5, XNA Targets, GLFW OK?

Monkey Archive Forums/Monkey Discussion/Hitchy Performance on HTML5, XNA Targets, GLFW OK?

zoqfotpik(Posted 2011) [#1]
I'm receiving rather hitchy, uneven performance on the XNA and HTML5 targets. This is visible not only in my test app but the Rockout demo included and the Asteroids game by TheRevills here:

http://www.monkeycoder.co.nz/Community/posts.php?topic=373&app_id=45

This performance issue does not occur with either Blitzmax or GLFW targets for the above apps, which is still not as glassy smooth as Blitzmax but is still quite nice.

My gut feeling is that this may be related to either some system priority issue or something with some garbage collection or intermittent process that may be kicking off, perhaps related to list management.

The best way I can describe the behavior is as an "intermittent hitchiness," meaning that it's not a steady every-frame chug or low framerate, but that some frames take maybe 1/20 second or so longer to render than others do, to no apparent pattern-- I wouldn't say that it's barely perceptible but that it's quite perceptible.

Any ideas?


DruggedBunny(Posted 2012) [#2]
It's probably to do with garbage collection -- RockOut in particular is not at all optimised for the more limited platforms (XNA is known to be very badly affected by GC) and it just spawns new objects, iterates through lists, etc, without a care.

I've just started experimenting myself with pre-allocating objects in arrays, re-using those array entries, and so on, in order to try and cope with this sort of thing. (Never had to bother until now!)


Playniax(Posted 2012) [#3]
Creating new objects at runtime is not left unpunished. But I think it’s not only that. I’m not sure that monkey uses vsync. The only target I’m sure about is iOS (by default it is disabled). I haven’t had a look at the others. Does anyone know if there is any vsyn supported? I think vsync is very important. I didn not take the time to investigate yet.


zoqfotpik(Posted 2012) [#4]
OK, I know how to handle this [for those who don't, make a class initialized at start that contains a large-enough array of objects, then do various list operations within that already-defined array... DruggedBunny: it's funny that sometimes the seemingly most brute-force programming is the best...]

This is not a vsync issue because again it is not happening every frame, there is something else going on and again my guess is garbage collection or something of the sort. It's very interesting to see the Blitzmax rockout running right next to the monkey XNA rockout, the difference is amazing.