ios - UICollectionView performance - _updateVisibleCellsNow -
i'm working on custom uicollectionviewlayout
displays cells organized day/week/month.
it not scrolling smooth, , looks lag caused [uicollectionview _updatevisiblecellsnow]
being called on each rendering loop.
performance ok < 30 items, @ around 100 or more, terribly slow. limitation of uicollectionview , custom layouts, or not giving view enough information perform correctly?
source here: https://github.com/oskarhagberg/calendarcollection
data source , delegate: https://github.com/oskarhagberg/calendarcollection/blob/master/calendarheatmap/ohcalendarview.m
time profile:
update
maybe futile? testing plain uicollectionviewcontroller
uicollectionviewflowlayout
given approximately same amount of cells/screen results in similar time profile.
i feel should able handle ~100 simple opaque cells @ time without jitter. wrong?
also don't forget try rasterize layer of cell:
cell.layer.shouldrasterize = yes; cell.layer.rasterizationscale = [uiscreen mainscreen].scale;
i had 10 fps without that, , boom 55fps with! i'm not familiar gpu , compositing model, not entirely clear me, flatten rendering of subviews in 1 bitmap (instead of 1 bitmap per subview?). anyway don't know if has cons, dramatically faster!
Comments
Post a Comment