I realize that the performance of using cornerRadius or shadow or other Core Graphics properties, it slows down the performance of the app(like when you scroll down UITableView, it's quite slow). Is there a way you can increase the speed and performance when using it?
-
i'm also experiencing the same problem with cornerRadius.. couldn't solve it yet. if i remove quartzcore props from the view, everything goes smooth again. – Furkan Mustafa May 25 '12 at 11:59
3 Answers
I made some profiling using instruments and in my opinion there is clearly a problem in performance regarding the cornerRadius property of CALayer.
I have a tableView with a complex TableViewCell subclass that has multiple labels, images and buttons.
When no cornerRadius is set, I get around 56fps while scrolling, but if I set the corner radius of an image, the frames per second are down to aprox 33.
I found this post very useful: there is one answer that suggests to create a mask for the layer instead of setting the cornerRadius. Based on my testings, the performance is much better with that.
Tipsy, There is a no such performance issue by using cornerRadius or masksToBound property or any other instance/class method of quartzCore framework. Try running instruments to find the exact cause of it. I am sure it is not because of any other Core Graphics properties .
Hope that helps !

- 144
- 9
-
have you tried adding shadows and that stuff? I think there is a performance issue regarding the use QC layer properties. Each developer should evaluate performance based on his case. In my opinion, when dealing with tableViews or constant view refresh, this properties can decrease performance. – Omer Aug 22 '12 at 23:27
This is a rather vague question. There is a well-known performance problem with setting a shadow on a layer, which can mostly be resolved by also setting the shadow path. I'm not aware of corner radius causing any problems.

- 118,105
- 32
- 252
- 268