I have an application that plays back video frame by frame. This is all working. however looking into performance issues and running traceview I noticed that there were a lot of calls to dispatch message, this was using a lot of cpu time.
As I looked at my app, I am using a handler to post a callback to the ui to display the current frame number. When I removed this all the dispatchMessage calls in traceview are gone.
So my question is, what is the best way to update the ui from a worker thread without experiencing so much overhead?
**NOTE, this call is made about 30 times a second.
The resources stated are good approached depending on needs. In my case it was a result of a couple minor things happening on the ui thread, mainly some simple transformations. I moved all of this to my background thread so I was drawing a pre transformed bitmap. This gave enough relief to the ui thread to resolve my problems.