Performance when frequently drawing CGPaths

后端 未结 5 1509
無奈伤痛
無奈伤痛 2021-02-01 08:16

I am working on an iOS App that visualizes data as a line-graph. The graph is drawn as a CGPath in a fullscreen custom UIView and contains at most 320

5条回答
  •  广开言路
    2021-02-01 08:35

    I am no expert on this, but what I would doubt first is that it could be taking time to update 'points' rather than rendering itself. In this case, you could simply stop updating the points and repeat rendering the same path, and see if it takes nearly the same CPU time. If not, you can improve performance focusing on the updating algorithm.

    If it IS truly the problem of the rendering, I think OpenGL should certainly improve performance because it will render all 320 lines at the same time in theory.

提交回复
热议问题