NSCollection re-display is slow upon reloadData

I am experiencing what looks like a slow fade in animation when I reload an NSCollection with a single cell.


I start with a small set (< 10) of data and load it.

Then I filter my data set down to one element and call reload -> I get a __slow__ refresh.

When I clear my filter, and reload then the refresh is near instantaneous.


I'm timing the call for both the filter and reload. Both are small


filter: Elapsed time is 1.99675559997559e-05 seconds.

load: Elapsed time is 0.000120997428894043 seconds.


But I am still seeing a slow refresh with the filtered set.


Any ideas? What should I be doing to diagnos this?


Thanks,

Jason

I've noticed redisplay can be a bit slow at times.


Is there anything in your collection view item set up you can optimize (your set up in)


-(NSCollectionViewItem *)collectionView:(NSCollectionView *)collectonView itemForRepresentedObjectAtIndexPath:(NSIndexPath *)indexPath
{
///set up here.
}

In my case, I was hititng a bottleneck when shrinking the collection view items (making more cells appear on screen at once) and my thumbnail loader (which looks for a thumbnail in the method above...and possibly sends a delegate message if a thumbnail isn't cached) was loading up like 200 small thumbnails really fast, and I got a thumbnail loaded callback too many times...so there were too many calls to reloadItemsAtIndexPaths: happening too quickly and it caused the app to block.


I got around this, by not loading the images in the background if the size of the item was smaller than a certain amount, because thumbnails of that size load really quick and I could dance around the problem of reloading too many items so quickly.

NSCollection re-display is slow upon reloadData
 
 
Q