OK, I'm doing some optimisation work on an app I'm developing so I can get the core down as much as possible to give me head room for more bells and whistles. This got me thinking about some of the internals of Gideros and before I start doing some of my own benchmarks I thought I'd see if either
@atilim or others in the community have some input on the following:
1. What is the rough overhead of Bitmap.new and TextureRegion.new?
2. Is it better to pre-define bitmaps (possibly as globals but I'm not sure I entirely like polluting that) and re-use them as needed, as everything will actually reference the single bitmap due to the way Lua works, presumably.
3. I'm really thinking about making some changes to BMFont which I've been pulling to pieces. The way the standard class (as downloaded from Github) works is that it grabs TextureRegions and creates bitmaps out of each character in your string every time you update the text. My thought here is to pre-grab the regions and create the bitmaps in advance on init as presumably this will provide a performance gain when updating text, but is there a large memory overhead to doing this I wonder (probably not, due to point 2)
So any thoughts? I'm already quite taken with point 2 for re-used components as this must provide a speed benefit so I'm going to run some tests now on that.
If none of this makes sense, or if I'm missing the obvious, do forgive me - been staring at the screen developing for the last 12 hours.
Cheers,
Gareth
Comments
So, is there any gain to pre-grabbing the TextureRegions?
Likes: ar2rsawseen, Mells
Likes: moopf
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps