I am writing a test application using Android SurfaceView. I want to see if it is a viable approach to 2D game development. At the moment performance is not too great.
There seems to be tiny little jerks and slowdowns every 15 or so seconds. I am only drawing about 30 rectangles on screen. I would hope it would be able to do this with ease.
I decided to profile performance. I log the average draw time every 10 frames. What I have noticed is that it goes periods with good draw times, and then it jumps up. I am certain my code does not allocate memory in the game loop, so I think this problem is not the GC.
Something I have noticed is that the performance drops about 100 frames in, write after a rather ambiguous log statement. Does anyone have any idea what might be happening with what android is printing.
Everytime I start app, the draw time drops after this log statement about removing file....
01-18 16:53:20.221 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 14 01-18 16:53:20.589 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 18 01-18 16:53:20.919 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 13 01-18 16:53:21.250 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 13 01-18 16:53:21.581 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 13 01-18 16:53:21.911 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 13 01-18 16:53:22.241 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 13 01-18 16:53:22.572 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 13 01-18 16:53:22.906 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 18 01-18 16:53:23.277 552-650/? D/TaskPersister﹕ removeObsoleteFile: deleting file=5725_task.xml 01-18 16:53:23.278 552-650/? D/TaskPersister﹕ removeObsoleteFile: deleting file=5725_task_thumbnail.png 01-18 16:53:23.330 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 32 01-18 16:53:23.680 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 18 01-18 16:53:24.032 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 20 01-18 16:53:24.399 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 31 01-18 16:53:24.777 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 26 01-18 16:53:25.148 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 23 01-18 16:53:25.473 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 12 01-18 16:53:25.804 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 14 01-18 16:53:26.142 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 14 01-18 16:53:26.467 19296-19370/com.example.scott.coloursquares I/game_screen﹕ draw time = 14