Optimization

Currently most of my work on Snorms is related to optimizations, as the whole engine was made to be isometric I had some specific optimizations for that view. But the thing is isometric view is very hard to optimize, unlike the top view there’s no way to cache layers of images as there are virtually thousands of layers. So I worked on rewriting lots of code to optimize things, results are very good so far.

  • LibGdx is now almost fully integrated (except audio part)
  • I can’t really get the maximum FPS rate on PC, I couldn’t find a way to have uncapped framerate with LibGdx yet, but by running render multiple times I think I have around 200-300 fps on my computer
  • Memory consumption is a lot lower, currently I set my max memory to 128m in eclipse, instead of 768m. I think I can manage to lower it again
  • On my Nexus 7, on a simple “paused” screen I can get 60 fps, which is great progress, on a more complex “paused” screen (lots of sprites and particles), I can get around 30-40 fps.
  • On an unpaused screen framerate is between 0 and 20 fps
  • The objective is to get 60fps on my Nexus 7, and 30fps on my Xperia Ray

The biggest problem I have on Android is memory, memory is very limited and it seems max memory can’t be set by a Java program, so I have to work with limited memory, and lots of Garbage collector. Garbage collector is very slow, so I have to get ride of most of it.

I made great progress thanks to Java VisualVM for recycling objects, but now I’m quite stuck as most of the memory deltas come from int[] types, so I don’t know where they are instantiated and I will have to manually review all the code.

Comments are closed.