I have some customers who have 10,000 images in their photo libraries on their devices and the image picker is very slow to open.
I noticed that an ELCAsset is created for each image in an album, each one contains 2 UIImageViews etc., are created on a non-main thread etc.
This is working against the whole point of having a UITableView reuse cells since it can create thousands of unused UIImageViews when we only ever see see a few dozen onscreen at any point.
By having the each ELCAssetCell own and create its own ELCAssets and then simply setting new images from the ALAssets as each cell is reused/configured the view will load instantly even when an album contains thousands of images and scrolling performance is unaffected. (since this is what UITableViewCell reuse was designed for)
Unfortunately, my code has diverged significantly (due to the nature of my app) so I cannot easily submit a patch but I wanted to help point others in the right direction.
I have commited 19147c008a409b8a30164b620c0652319e0da578 which should remedy this initial loading of the ELCImagePickerController, and should work lots better on devices with many images.
I have some customers who have 10,000 images in their photo libraries on their devices and the image picker is very slow to open.
I noticed that an ELCAsset is created for each image in an album, each one contains 2 UIImageViews etc., are created on a non-main thread etc.
This is working against the whole point of having a UITableView reuse cells since it can create thousands of unused UIImageViews when we only ever see see a few dozen onscreen at any point.
By having the each ELCAssetCell own and create its own ELCAssets and then simply setting new images from the ALAssets as each cell is reused/configured the view will load instantly even when an album contains thousands of images and scrolling performance is unaffected. (since this is what UITableViewCell reuse was designed for)
Unfortunately, my code has diverged significantly (due to the nature of my app) so I cannot easily submit a patch but I wanted to help point others in the right direction.