maui
maui copied to clipboard
[iOS] Improve background layer frame mapping performance
Important
This PR Obsolete
s a couple of methods.
static Microsoft.Maui.Controls.Platform.BrushExtensions.UpdateBackgroundLayer(this UIKit.UIView view) -> void
static Microsoft.Maui.Platform.ViewExtensions.UpdateBackgroundLayerFrame(this UIKit.UIView! view) -> void
Description of Change
Using https://github.com/davidortinau/AllTheLists app, and scrolling through collection view with Border
inside we can clearly see that a good amount of time is spent in UpdateBackgroundLayerFrame
which is needed to sync the sublayer with the UIView.Layer
.
This has an impact on both MappingFrame
and ContentView.LayoutSubviews
:
Which translated to these timings
This PR gets rid of all mapping frame code and simply adds an observer on the sublayer.
As a result we get a lot of improvement (80%):
While the new observer is super fast
Issues Fixed
Fixes #24847