samedi 7 février 2015

Android update loop with sqlite too slow

My app has an "update state" loop that at any iteration constructs a string and do a sqlite rawQuery with this string. A cursor get the output and update the state. Then the state must be drawn to a SurfaceView using canvas. I'm testing performances without the graphics.


I noted that the update take even 1 second per iteration on my emulator. This is ridiculously big since I want an animation with a decent fps! I'm not doing test on the drawing part so I don't think things like using OpenGL instead of Canvas will help me! Is possible to have an update rate of 1 sec because of the sqlite queries???


I have not the possibility of test on a real device... Is the emulator so slow or my code is problematic?


Aucun commentaire:

Enregistrer un commentaire