tristanhimmelman / THSpringyCollectionView

A memory and CPU efficient implementation of a collection view with cells that bounce around like they do in the iOS 7 messages app
MIT License
726 stars 92 forks source link

Super laggy and inefficient if number of cells > 100 #11

Open ssfking opened 10 years ago

ssfking commented 10 years ago

Starts lagging really badly after 100 cells. Did some debugging, found out that PrepareLayout gets called like every 0.01 second on scrolling... in other words, collectionview asks for all cells for their respective height every 0.01 second - performance gets really bad if you implement customized cell height.

Any chance this can get fixed?

tristanhimmelman commented 10 years ago

Unfortunately I do not have any spare time to spend on this project at the moment.

The project is mostly a experiment that I decided to put online to give others a place to start when building this kind of UI. It is unlikely that I will work on it in the near future. Contributions are welcomed though!

badeleux commented 10 years ago

it's probably because you calculate size for each cell each time when sizeForItem is called, and it's called very often!

KittenYang commented 10 years ago

YES,Above is right!