Android mode takes a lot of time in between draws... why?

edited August 2015 in Android Mode

I just finished a very big android app. It's working great, and I've spent many hours to optimize my code to the max. The way I did this is by placing println(millis()) in a lot of places in the code and checking how long it took the program to run the code. This way I've been able to optimize my code to the max, but I'm kind of having a problem with how long it takes processing to get from the end of the last draw(), to the beginning of the new.

Here's a test running on my big app:

Beginning of draw: 12564
End of draw: 12591
Beginning of draw: 12607
End of draw: 12634
Beginning of draw: 12650
End of draw: 12677
Beginning of draw: 12694
End of draw: 12721
Beginning of draw: 12738
End of draw: 12765
Beginning of draw: 12781
End of draw: 12808
Beginning of draw: 12824
End of draw: 12851
Beginning of draw: 12867
End of draw: 12894
Beginning of draw: 12910
End of draw: 12938
Beginning of draw: 12954
End of draw: 12982
Beginning of draw: 12999
End of draw: 13026
Beginning of draw: 13042
End of draw: 13069
Beginning of draw: 13109
End of draw: 13125
Beginning of draw: 13136
End of draw: 13151
Beginning of draw: 13162
End of draw: 13174
Beginning of draw: 13185
End of draw: 13196
Beginning of draw: 13205
End of draw: 13216

Looking at just the last 3 lines, my code takes 11 milliseconds to run (which is great judging by the size of the app). The difference between the end of the last draw and the beginning of the next draw is 11 milliseconds, which I think is way too long. In the setup I set frameRate to 200 by doing:

frameRate(200);

It's not making that by far. Why does processing eat so my time in between draws?

Tagged:
Sign In or Register to comment.