iOS 15 SDK中[MKAnnotationView setBounds:]调用出现性能降级问题
MKAnnotationView 版本兼容性性能问题说明
我通过继承MKAnnotationView创建了自定义标注视图,并重写了[MKAnnotationView setImage:]方法。
当[MKAnnotationView setImage:]方法被调用时,会触发[MKAnnotationView setBounds:]调用,进而执行[MKAnnotationView _metricsDidChange]及其他相关方法。
经性能分析发现,[MKAnnotationView _metricsDidChange]是本次性能问题的瓶颈点,而在iOS 14 SDK中不存在该方法调用,不会出现此性能问题。
性能分析截图
- iOS 14 SDK性能截图:

- iOS 15 SDK性能截图:

内容的提问来源于stack exchange,提问作者HongchaoZhang
相关产品推荐
相关产品推荐

