Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Amazing Race: Performance of Standard iOS Elements and Technologies

jkutyn
September 10, 2018

The Amazing Race: Performance of Standard iOS Elements and Technologies

We all know that autolayout comes with a performance hit, but how does it really compare to manual layout, especially with the improvements to the autolayout engine in iOS 12? And what’s a performant way to round the corners of an image? CoreText, UILabel, UITextView: how do all the different ways to draw text perform against each other? Let's discuss the performance differences between comparable iOS elements and technologies.

jkutyn

September 10, 2018
Tweet

Other Decks in Technology

Transcript

  1. Measuring Performance Always test on device instead of the simulator!

    iPhone X, iOS 11 Repeat testing Find average result
  2. Execution time CoreGraphics CALayer + clipsToBounds CALayer + mask CALayer

    + masksToBounds Time in Milliseconds 0 1 2 3 1,41 1,66 1,91 2,4
  3. Execution time UIImage CALayer CoreGraphics CALayer + shadowPath Time in

    Milliseconds 0 2 4 6 8 10 2,14 2,33 3,34 9,82
  4. Execution time AutoLayout UIStackView Manual Layout AutoLayout iOS 12 Time

    in Milliseconds 0 2,8 5,6 8,4 11,2 14 6,65 1,7 12 14
  5. Final Thoughts UIKit elements have overhead CoreGraphics vs CoreAnimation AutoLayout

    always slower than manual Up to you to choose what meets your needs