tipsywacky
tipsywacky

Reputation: 3464

optimizing the performance of <QuartzCore/QuartzCore.h> core graphics iOS?

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?

Upvotes: 1

Views: 829

Answers (3)

Omer
Omer

Reputation: 5580

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.

Upvotes: 1

jrturton
jrturton

Reputation: 119242

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.

Upvotes: 0

Aniket K.
Aniket K.

Reputation: 144

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 !

Upvotes: 0

Related Questions