4
votes

I have a grid CALayer (with a parent NSView, enclosed by an NSScrollView) that contains a bunch of sublayers, each sublayer drawing an image. When I disable the shadows for the sublayers, the performance is great. However, as soon as I enable them, drawing starts to lag badly.

Are there any things I can do to improve this? I've heard of using shouldRasterize on iOS to improve shadow performance, but that property is not available on OS X.

2

2 Answers

2
votes

Have you turned on layer-backing? Then the drawing contents would be cached and that might improve performance.

4
votes

I ran into a similar problem, by setting the shadowPath property of the CALayer I got a significant performance boost.