3

I've just started to profile my app at its prototype stage using Traceview.

I've found that the main user of cpu time (90%) is Handler.dispatchMessage. The main user of real time resource (50% combined) is MessageQueue.next and MessageQueue.nativePollOnce. Calls made by my own methods account for, on average, 2% of real time resource each.

Currently, whilst I am still developing the app I have toasts that appear when there is interaction with my service. I am assuming (about to test the theory tonight) that these calls are down to my frequent use of Toast. Is this correct?

Since Toasts appear on top of the activity whilst you are still using it, having its usage appear in Traceview is a bit deceiving. Is there a way to filter out certain method calls in Traceview, or will I just have to comment the Toast calls in my code, re-build, and re-test? I suppose using a SharedPreference to set whether to use Toasts or not might be useful.

Thanks for the help.

  • I would recommend discarding the `Toast` invocations entirely. Use LogCat via the `Log` class. Not only are you less likely to miss a message, but you get timestamp information, the ability to review the results later, full color-coding and filtering capability in the graphical LogCat viewers, etc. As to whether your `Toast` invocations are affecting your traces, I cannot say, as I have never profiled a `Toast`. – CommonsWare Apr 13 '13 at 15:16
  • Yeah, I was planning on switching them over tonight. They have been useful for developing the service class. Thanks. – confused_at_times Apr 13 '13 at 16:26

0 Answers0