7 ms·
"Constraint layout systems are O(n^2) algorithms, while a procedural layout algo can be O(1) or O(n)." Those are the upper bounded constraints, but not reality
by jomamaxx 10y ago
"Constraint layout systems are O(n^2) algorithms, while a procedural layout algo can be O(1) or O(n)."
Those are the upper bounded constraints, but not reality.
Pragmatically, there's no reason 'constraint bounded' algs can't - in practice - approach procedural layouts.
Second, is the fact that layout is becoming less and less of an issue re: performance, to the point that in a few years, the argument may be moot.
Third, I'd argue that 'performance' is only one factor.
But good point.
- mahyarm 10y agoI wish iOS autolayout wasn't n^2. You have to realize these algorithms have very small time budgets and you can start seeing stutters when you use them in things like UICollectionViews and UITableViews and other scrolling / gesture contexts. Performance is still a very real thing for these things. Devices you support will also last 5+ years and I don't think we will see the same power/performance ratio gains in mobile in the next 5 years like we have in the last 5 years. I bought an iPad Mini 4 recently and I see general stuttering in the OS programs alone and it's the most recent iPad Mini you can buy! You can have something pretty close to constraint based layouts in procedural layouts in something like "snap view 1 bottom to view 2 top", etc.