I'm trying to optimize the scrolling speed and smoothness of my UICollectionView
(using a custom layout) that has about 400 cells, 150 of which are visible on the screen at the same time.
The cells themselves aren't very complex: They consist of a (fully opaque) colored background and two labels (with the same background color).
So far, I've read dozens of posts on optimizing speed by
- properly reusing cells,
- avoiding transparency in all backgrounds,
- avoiding box shadows,
- avoiding corner radius, and
- avoiding fractional cell positions and sizes.
Despite all these optimizations, I still can't scroll smoothly with 60 fps. I've also tried layer rasterization (shouldRasterize
) after dequeuing cells, but that had a negative impact on performance.
Reducing the amount of cells that are visible at the same time is the only thing that improved performance — scrolling is totally smooth with fewer cells. Unfortunately, that's not an option.
What else can I do to get close to 60 fps with many UICollectionViewCell
s visible at once?