Also there's overhead associated with putting the code into the middle of the draw loop. The speed at which this loop runs will depend on more than just the code you want to target. Maybe alter it so that it spawns a separate thread which performs whatever code you're testing and just have it report back every X iterations how fast its running. That would eliminate some of the jitter due to variations in drawing time, as well as anything else that the drawing thread is doing.
On May 20, 4:21 pm, Romain Guy <[email protected]> wrote: > Hi, > > Your results may be skewed. If you are dividing integers by 2 it's not > the same as multiplying an integer by 0.5. In the first case, you are > performing an integer division, whereas in the second case you are > performing a floating point operation (which results in the end in a > cast back to integer.) > > If that's what you did, testing operations on an integer, then the > result is not surprising. > > On Wed, May 20, 2009 at 12:33 PM, Robert Green <[email protected]> wrote: > > > I thought others would find this really useful so I posted my FPS > > counter app that lets you throw whatever code in the draw loop and > > prints out an average of the last 10 frames FPS. I used this to find > > out that dividing by 2 is over twice as fast as multiplying by .5, > > which is something 2D games do a lot to work with sprite positions. > > > Here is my code for all of you to share and be plentiful with: > > >http://www.rbgrn.net/content/286-how-to-test-android-performance-usin... > > -- > Romain Guy > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time > to provide private support. All such questions should be posted on > public forums, where I and others can see and answer them --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

