-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Very slow opening of picker when media is over 8K #62
Comments
I am having the same issue. |
@DragonCherry I'm talking not about the quality but a count of photos and videos in the media library. So, my library is over 8000 photos and videos. |
I looked in to this briefly, I currently use a different library which opens instantly where as this takes a few seconds before opening. I think it's due to the asset manager doing too much upfront. it loads every album and does an asset fetch request for each one. |
@Ava8, @Ashu , @DavidBoyes |
I use an iPhone XS Max. ~36,000 images, iCloud enabled. Definitely noticeably slower than other libraries I have used to initially open. I'm looking in to it now. fetchAlbums takes around 0.9 seconds to complete and selectAlbum around 1.4 seconds. Overall it can take 2.5-3.5 seconds to complete viewDidLoad in AssetsPhotoViewController. Update: Update 2: I removed it from the code, as well as the assetArray. This took the viewDidLoad method down to 0.12 seconds to complete. The assetArray was replaced by just using the fetchRequest directly. However syncing changes had to be commented out for this to work. I have moved the creation of fetchMap to be more on demand in |
This issue occurred to me on a iPhone X. Currently, I don't have that device, so can't share much info about it. It works perfectly fine on my iPhone 5s with 5000 images. Also works in iPhone 6. I guess this issue occurs only on newer phones. Need to check again in new devices. Will let you know soon. |
@Ashu Is that comparing with the same image set on all devices? |
No. The image set was different. iPhone X was used by professional photographer, so it might have some RAW images. I need to check that. |
Ok, I tried on an iPhone 6S with ~5000 images, and it was faster but I would guess relative to the amount of images/albums rather than a device specific thing. |
have the same issue iPhone XS having 4k++ photos. opening picker takes ~3secs. |
A work around that removes some of the delay (not all) is to move fetchAlbums to a background thread. You'll have to manually specify the defaultAlbum in fetchAssets() so it loads the initial set of photos. |
I have the same issue. 3000+ pics on my iPhone 6s and it took about 2s to open. I then wiped my iPhone and it'll open almost instantly. |
To get around the performance issue with loading (I have a customer with a high bar), I created a hack in my app. I load the picker's view and then stash it as a hidden view in the main view of my app. This causes it to load while the user doesn't notice. Then, I add the view controller as a child view controller and move the view back. This works surprisingly well. My issue is that there is no way to programmatically deselect assets that are not selected in the current album. Would it be possible to make |
@avi-screenovate |
|
Having this issue as well, takes a good 7 seconds for |
@Ava8 @DavidBoyes @Ashu @rad182 @zongziyao @eytanschulman @DragonCherry Hi guys, I have optimized accordingly for this issue, for more details please see : pull request #86 Please provide me with new test data and feedback to help me better refine the optimization section. |
Please consider replacing this library with PHPickerViewController. |
While native solutions are always better, |
I have two devices, on each is over 8K media, so when I open assets picker, I wait for а minute or more for loading image gallery.
The text was updated successfully, but these errors were encountered: