Caton optimization -CPU

Try to use lightweight objects, such as CALayer instead of UIView, for places that don’t handle events

Don’t make frequent calls to UIView properties such as frame, bounds, Transform, etc., and minimize unnecessary changes

Try to calculate the layout in advance, adjust the corresponding attributes at one time if necessary, do not modify the attributes more than once

Autolayout consumes more CPU resources than setting the frame directly

The image size should be exactly the same as the UIImageView size

Control the maximum number of concurrent threads

Try to put time-consuming operations into child threads

Caton optimization -GPU

Try to avoid the display of a large number of pictures in a short period of time, as far as possible to display a composite of multiple pictures

Minimize the number of views and levels

Reduce transparent views (alpha<1) and set Opaque to YES for opaque views

Try to avoid off-screen rendering