You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.
When an arrangement's UIViews are expensive to create and configure, makeViews can take more time than is available between frames.
Current idea is to add an asyncMakeViews method that would walk the arrangement tree in batches, checking CADisplayLink for whether to pause the walk to let a frame render.
The text was updated successfully, but these errors were encountered:
I am curious if you have have a concrete example of this actually being a problem (what does the view look like and how big is it?).
You will need to be careful about synchronization. For example, if another makeViews pass starts for a new layout, you will want to cancel the async makeViews for the previous layout if it is still happening.
Also think about how this will impact animation (I don't think it is possible to do both).
The size is about a screen-full or more and includes expensive views such as UITextView. According to profiling, much of the time is spent in makeViews, either constructing UIView instances or running config blocks. One workaround has been to async dispatch the config blocks to run a bit later, and to stagger them so that they don't get bunched up again. This cut the framedrops by half, which matched the approximate breakdown between the time spent on UIView instantiation and on config blocks. The only thing we haven't done was to add stopwatch/print calls around the makeViews calls to confirm that those times correspond closely to the number of frames dropped.
Good points about synchronization, cancellation, and animations.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When an arrangement's UIViews are expensive to create and configure,
makeViews
can take more time than is available between frames.Current idea is to add an
asyncMakeViews
method that would walk the arrangement tree in batches, checkingCADisplayLink
for whether to pause the walk to let a frame render.The text was updated successfully, but these errors were encountered: