table view scrolling: »Cutting to the chase, here’s the secret: One custom view per table cell, and do your own drawing.« Does this still hold true today? TL;DR: No
within 1/60s (Drawing + Compositing) 2. Animate existing textures on screen at 60fps (Compositing) Each step has very different performance characteristics What makes drawing fast makes compositing slow We have to strike a balance between the two
GPU The GPU composites these textures into one coherent image Compositing of two non-opaque pixels: 0.5 0 0.5 RGB Value = 0 + 0 * (1 - 0.5) = 0 0 1 0.5
60 times/s The display link gets called at 60fps refresh rate, less if drawing takes longer We also get the timestamp of the last refresh This enables accurate timing of how long drawing takes
bitmap before compositing it to its destination Cached bitmap is reused in seubsequent frames Imposes a one time performance hit per layer Can make performance much better or way worse
is expensive!) Don’t draw the image, use an image view or set it as a layer’s contents CAGradientLayer Offloads the CPU and creates the gradient on the GPU Core Graphics Drawing gradients with Core Graphics is CPU intensive
on screen and animating existing views We’re more likely to be CPU bound on iPhone @2x screens On the iPad it depends – being GPU bound is still a possibility Composite views/layers if you’re not GPU bound Only go to drawRect: if compositing becomes the limiting factor