What exactly constitutes as byte usage in a template?
Posted: 23 Mar 2013 02:12
So, I've got a hefty template, running at 67% byte usage, and dropping my FPS to 30 on the iPad 2, file size is 2MB.
Things seem to be holding up just fine but I start to worry about how much more I can add.
My first instinct was to cut down on the file size. I've got an obfuscation system written in PHP, and I set it up so that no variable, script, or object's name is longer than 5 characters, so:
MyScript() becomes f123()
MyOtherScript() becomes f124()
variablename = v123
objectName = o123
etc...
I ran this, and cut the filesize from 2 mb down to 1.75 mb. A hefty 12% drop! But, byte usage remained at 67%. Bummer.
So, I can only assume that
a) the readout of byte usage is POST compiler, which I'm also assuming simplifies all entity names into the rawest form possible
b) the readout is more tied to the variable listner and onFrame scripts, so it basically monitors the bandwidth (excuse my possible bastardization of terms) usage within lemur.
If that's the case, I'm probably S.O.L. for the most part.
My only question would it be, is it cheaper to have one variable listener function, that listens for any of say four variables to change rather than having 4 individual functions that each listen to those individual variables? It does not seem like that would be the case, either way lemur has to listen to all of those variables.
Also, does storing the contents of an onFrame and/or listener function inside a manual function that is simply called in these more resource intensive functions a cheaper way to go? My intuition again is no, but I'd like to be sure.
Things seem to be holding up just fine but I start to worry about how much more I can add.
My first instinct was to cut down on the file size. I've got an obfuscation system written in PHP, and I set it up so that no variable, script, or object's name is longer than 5 characters, so:
MyScript() becomes f123()
MyOtherScript() becomes f124()
variablename = v123
objectName = o123
etc...
I ran this, and cut the filesize from 2 mb down to 1.75 mb. A hefty 12% drop! But, byte usage remained at 67%. Bummer.
So, I can only assume that
a) the readout of byte usage is POST compiler, which I'm also assuming simplifies all entity names into the rawest form possible
b) the readout is more tied to the variable listner and onFrame scripts, so it basically monitors the bandwidth (excuse my possible bastardization of terms) usage within lemur.
If that's the case, I'm probably S.O.L. for the most part.
My only question would it be, is it cheaper to have one variable listener function, that listens for any of say four variables to change rather than having 4 individual functions that each listen to those individual variables? It does not seem like that would be the case, either way lemur has to listen to all of those variables.
Also, does storing the contents of an onFrame and/or listener function inside a manual function that is simply called in these more resource intensive functions a cheaper way to go? My intuition again is no, but I'd like to be sure.