title: Profiling and Optimizing a game android
body: <p>I'm making my first Android game which is going to be a 3D arcade-ish game using opengl es. I've been working on it for quite a long time, mainly optimizing the engine for flexibility for the future.</p>
  
  <p>Anyways now I'm completely done with the games features and all the pretty stuff, but it laggs on phones that AREN'T my debug phone. The game has pretty high-quality graphics for a mobile game so a little lagg is expected, but the difference in performance between running the game on a Nexus S and running it on a MyTouch 4G is huge. The game isn't even playable on lower-end phones like the LG Optimus(the game runs, but its too choppy to play comfortably). On my Nexus S I rarely if ever get choppy movement(I've implemented frame-rate independent movement in the game) but on the MyTouch 4G it is a lot more common, although the game is still playable....but annoying</p>
  
  <p>I come from a desktop game-development background, and optimization has never been subject of interest for me before. What can you recommend to help me speed up the game?</p>
  
  <p>I've tried optimizing code as much as I possibly could, and the performance has improved significantly, but there seem to be some things that I've missed or am overlooking. Its a huge game with a full engine and lots and lots of code.</p>
  
  <p>I've tried tracking down all allocations and making sure they aren't deallocated or forgotten during runtime so that the GC doesn't get invoked while you are playing. Thats basically all I can think of doing, I don't know what else could make it lagg</p>
  
  <p>And I doubt its the poly count of the meshes because even though they are high quality, I added an option in the game that lets you choose the quality of the graphics from Low, Medium, and High much like on a computer game, and the difference between Low and High are somewhere between 600-900 vertices! The only improvement I've noticed that gives is load time. Also there aren't any special post-processing effects, lighting, shaders, realtime SSS, or any of that. Just textured faces :P</p>
  
  <p>also the "lagg" I'm reffering to are random freezes. I'm pretty sure they are the GC, but it could be something else since I <em>think</em> I've found and controlled all allocations(there are a lot). Since my game is frame-rate independent, whenever it unfreezes, the player and enemies and everything 'jumps forward' to keep up, and this makes an already difficult game a LOT more difficult!</p>
  
  <p>I'm new to profiling, and optimization. How can I use the android debug tools(or other third-party tools) to get a better picture of how my game performs during runtime, and when/why it freezes so that I can fix them.</p>
  
  <p>ALSO, bonus question :) : is there a way for me to see how it would perform on other phones without actually having the phones or knowing people who have them? Like, how fast would it go on a Droid X even though I don't have a Droid X nor does anyone I know</p>