Potential performance gain in Mojo?
Monkey Targets Forums/Android/Potential performance gain in Mojo?
| ||
Not sure how applicable this is to current Monkey, as we're using our own greatly modified version from a while back, but: On Android, we noticed that a lot of memory was being consumed by bitmaps (the app-side copy of GL textures). We also noticed that re-binding them on resume was REALLY slow (since it allocates memory and a bytebuffer and does an alpha-premultiply pass). It turns out that you can simply do this when the bitmap has loaded: GLUtils.texImage2D(GLES11.GL_TEXTURE_2D,0,bitmap,0); This does the premultiplication for you, MUCH faster. In addition, provided you reload on resume, you can do this: bitmap.recycle(); bitmap = null; java.lang.System.gc(); which frees up the app-side memory. If you keep the bitmaps around, resuming is near-instantaneous, even with a large number of large textures. Even if you ditch them, reloading and using the method above to upload them is around 10x faster than the manual premultiply. |
| ||
Yeah, it I found it when helping Simon from NewStar with NSS several years back now: http://www.monkey-x.com/Community/posts.php?topic=2589. It's been rediscovered as an issue several times since but for whatever reason Mark has never implemented a fix. |
| ||
Well now, there's a coincidence... |