This page contains benchmark results for LayoutKit, Auto Layout, and manual layout code.
LayoutKit is as fast as manual layout code and significantly faster than Auto Layout.
Benchmarks were run on an iPhone 6 running iOS 9.3.2 with Swift optimization turned on.
Notes:
estimatedItemSize
is hard to use so these tests usesizeForItemAtIndexPath
.- UICollectionViewFlowLayout requests the height of all cells during layout (even those that are off screen). This is why layout performance keeps getting worse as number of cells are added to the UICollectionView.
Notes:
- Unlike UICollectionView, UITableView defers asking for the height of cells until it is needed. This is why performance is constant for seven or more cells.