-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Flickering and performance problems of layerBacked ASDisplayNodes #37
Comments
Jercik, thanks for reporting this! I'm surprised this is happening on the layerBacked node—I'd actually expect it to occur on the view-backed one, since when the views are removed from the hierarchy they will automatically clear their contents to save memory. This is not always the behavior you want, and so I'm actively thinking about the right API to expose this. There is an AsyncDisplayKit call that will cause nodes to ignore UIView notifications (such as didMoveToWindow:nil, when being removed from the hierarchy, so it doesn't clear the contents). However you shouldn't be expected to do this in a bunch of places, so we need to fix this in another way. If you can provide a sample project, that would be especially convenient. We are planning to launch the framework quite soon and I'd love to look at this tonight, tomorrow or over the weekend. Thanks again, and feel free to ask us any other questions! |
Thank you for quick response! Here is example project: https://github.com/Jercik/asflickering On layer-backed nodes, flickering is more visible and occurs more than once, but also on view backed nodes one additional redrawing and flicker is visible after dismissing presented view controller. It would be great, if there was some way to avoid this behavior. |
I have a diff that should resolve this and will try to land it tomorrow once I can get it reviewed by a team member and we can test it properly. Here's the raw diff if you're compelled to poke around with it, but this should be closed out within 24hrs! |
f7d91bb fixes this. |
Indeed, fixed (verified with your test case @Jercik — very helpful, thank you!) |
I'm seeing this effect with version 1.9. Especially during push and pop in a UINavigationController. |
still get blink when pop back |
Setting "layerBacked" value to YES is recommended for performance, but I've found that in certain situations it causes ASDisplayNodes to flicker and perform additional (and unnecessary) drawing.
Here you can see flickering when presenting and dismissing view controller:
Only difference between two nodes is layerBacked property set to YES on right one.
I'm using long emoji string to make drawing more expensive so flickering effect is visible on simulator. On devices effect can be observed also with strings that are much less expensive to draw.
Same effect and can be observed with ASImageNode.
I can provide example project if necessary.
The text was updated successfully, but these errors were encountered: