Skip to content

Comment on Auto Layout Performance on iOS

Comments

Those look like parabolas, which implies that there's something O(n^2) going on. Since autolayout has to evaluate each constraint against the other constraints, this shouldn't be too surprising.

Like other commenters, I find the 1,000 subview test runs pretty silly. (Pro tip: if you need to put thousands of things on the screen, you don't want to give each one its own view. They aren't that light no matter how you lay them out).

This stuff is pretty clearly optimized for use with a handful to a few dozen views. It would be great to see a performance comparison for that range.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.