08-04-2011 03:49 AM
My app takes about more than 1 minute to open. When the app is already run, the "sending data" and "receiving data" icons keep flashing. And my BB turn to be a bit sluggish/unresponsive.
I'm guessing the cause is bad thread management. Now my question is: is it possible to automatically profile all the running threads from the app? I did a quick search before, and found this. That page tells you to "Specify a breakpoint". The problem is threads are used accross the code, and I guess it would be tiresome to specify each breakpoint for them.
08-04-2011 05:15 AM
Sluggish and unresponsive immediately suggests to me that you are running stuff on the Event Thread - well written background Threads doing network I/O in my experience anyway, do not impact the UI.
I would add more logging to your processing so that it is clear what is actually running at any point and look for some consistency in what causes the ui sluggishness.
The other common cause for sluggishness is the garbage collector, but you don't mention that at these times you see an hour glass appearing - if the garbage collector is running you will see this.
My experience with profiling is that you do need to have a section of code you wish to optimize and put breakpoints around that.