blitz-research / monkey

Blitz Research Monkey Source
226 stars 59 forks source link

Use .length rather than Array.getLength #5

Closed ootsby closed 11 years ago

ootsby commented 11 years ago

Array length queries were taking over 3% of the processing time on my Android build. The .length field is directly used in the Bool cast code so presumably there's no concern with doing so elsewhere.

Edit: Ah. I didn't realise that pull requests were per branch. If you want one change and not the other and can't disentangle the commits then let me know and I'll split them. The second change (and the 3rd fixing the 2nd) is also mostly for Android performance. EndUpdate was taking nearly 2% of the processing time.

blitz-research commented 11 years ago

I'll definitely make the array length change, probably manually.

Not sure about the KeyHit one yet - I have some other stuff to look into input wise so will look into this at the same time.

EndUpdate was taking nearly 2% of the processing time.

Not sure what this means - if OnUpdate is empty, EndUpdate may take near 100+% of processing time!

ootsby commented 11 years ago

Not sure what this means - if OnUpdate is empty, EndUpdate may take near 100+% of processing time!

2% of the time in a physics intensive game not reaching its set update rate.

perf

blitz-research commented 11 years ago

2% of the time in a physics intensive game not reaching its set update rate.

Ok, that's worth fixing, I'll do it myself though.

Thanks for the tip!