NSLog(@"%@", [[[UIApplication sharedApplication] keyWindow] performSelector:@selector(_autolayoutTrace)]);
po [[UIWindow keyWindow] _autolayoutTrace];
Cocoa layout example
Autolayout performance
http://constraints.cs.washington.edu/cassowary/
"the amount of time it takes to solve the constraint system increases disproportionally relative to the number of constraints involved."
A flat hierarchy of views, absolutely positioned in the root view
A flat hierarchy of views, relatively positioned to each other
A nested hierarchy of views, relatively positioned to each other
compare all
Let's look at our flat layout. While the position constraints need to be on the root view, the size constraints don't. I changed the code so that the size constraints were being added to the subview instead, and got the following results:
all the constraints relating to a view can be put in the immediate superview, dramatically increasing the locality. The graph below shows just how significant an improvement this gives.