I have been debugging UITableView rendering performance when scrolling in Project-D because I feel it is a bit sub par.
Project-D uses a custom UITableViewCell designed in IB with the exact same method I talk about in my howto blog post you can find here: http://simon.nureality.ca/?p=91
I have used a lot of transparent images, and the upcoming Ticker at the bottom of the application may also be causing additional alpha blending.
I believe the performance has something to do with the amount of alpha blended layers I have added in my UI.
I have not yet found the solution but I did find a nifty way on the device and simulator to make the display visualize the alpha blended layers in shades of green/red.
Green is good, red is bad. The more red, the more alpha blending is occurring in that region. Alpha blending is very expensive on the iPhone.
As you can see, most of Project-D is red and in some areas a deep red which I suspect means alpha layers on top of alpha layers. I did heavily use transparent png’s and perhaps went a bit too much and am curious how this has affected iPhone 3G users since I own an iPhone 3GS and I am just now just barely noticing a bit of what feels like frame rate impact.
You can do this on device or simulator however I like the simulator method the best because once launched, you can continue development in MonoDevelop, where as with Instruments on device you have to run it in Xcode and attach separately in Instruments.
Here’s how to launch the simulator with visible alpha blended layers enabled:
1. Open a new file in TextEdit
2. Click Format -> Make Plain Text
3. Enter the following in the document
CA_COLOR_OPAQUE=1 /Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator
4. Save as Simulator.sh on the desktop.
5. Start Terminal and chmod +x Simulator.sh
6. Double click Simulator.sh on the desktop and the iPhone Simulator should run with layers showing up in shades of red and green.
7. Run your application or start it via the brand new MonoTouch/MonoDeveloper debugger.
8. Play with your app ui and watch the invalidated regions.
Enjoy! As always feel free to retweet the post and you can always find me on twitter via @simongui