I have a NSScrollView with many subviews ( greater than 100 ).
- The subviews are position constrained using autolayout to subview.center to edge of superview on horizontal/vertical axis.
- The subviews have dynamic internal content which can force the subview to grow or shrink as needed.
Scrolling works perfectly. Responsive scrolling is smooth and fast.
Magnification is horrible. Id be lucky if im getting 2-3 fps.
How can I optimise?
- using can Draw Subviews Into Layer on parent and children.
- hiding views.
- using shouldRasterize.
- removing subviews during magnify and replacing at end.
- replacing the entire document view with a shadow proxy.
What I have noticed is that each frame seems to want an auto-layout pass which is what is sucking up the CPU. Yet the layout of the view doesnt go dirty during a magnify. As pointed out in the WWDC sessions auto-layout for siblings is roughly linear on count so it makes sense that magnification is smooth when the subview count is fairly small.
Any ideas
Thanks
Warren