To use shouldRasterize or not to use

ios, objective-c, xcode

Solution

The `shouldRasterize` option is no silver bullet and it depends entirely upon what the view does. In my experience, it helps when performing animation of some view for which redrawing it from scratch is very expensive. But as David suggest, you should let your empirical results on devices dictate your final assessment of when and where you use it. See the Rasterization discussion roughly 13:20 into the WWDC 2012 Polishing Your Interface Rotations video.

Problem

I'm trying to optimise performance on my app, and playing around with `shouldRasterize`. I have a background view with a opaque subview on top. If I set the subview to `shouldRasterize`, it turns yellow when checking the "color offscreen-render". If I have understand it correctly, you should try to minimize the offscreen-render, but shouldRasterize normally increase performance on a static subview that won't change? Should I keep `shouldRasterize` on or off here? Thanks

Original source