Skip to content
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

Changed ImagePrefetcher to process images in a background queue instead of the main queue #957

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

gordontucker
Copy link
Contributor

When we tried to use ImagePrefetcher in a collection view that loaded the next few dozen images it caused very noticeable stuttering while scrolling. By moving the logic that handles the image downloading to its own DispatchQueue, it removed the stuttering completely and runs much smoother.

I can't see any side effects from this change so I figured I'd put in a pull request in case anyone else wanted to make their app a bit smoother. If you are curious they amount of stuttering it fixed, I'm attaching videos of how it looks before and after the proposed change.

Kingfisher-before-and-after.zip

@ejmartin504
Copy link
Contributor

I believe our app is suffering from the same issue. We prefetch a LOT of images when we first load the app, and our tableView starts to stutter.

@onevcat I think this would be a great addition to the library 👍

@onevcat
Copy link
Owner

onevcat commented Jul 24, 2018

@gordontucker @ejmartin504

Sorry for the late reply. LGTM at the first glance. I'd take a detailed look at these changes and merge it ASAP.

Thanks!

@onevcat onevcat merged commit 052e483 into onevcat:master Jul 24, 2018
@ejmartin504
Copy link
Contributor

Great, thank you @onevcat!

petarlazarov pushed a commit to dowjones-mobile/Kingfisher that referenced this pull request Oct 6, 2021
Changed ImagePrefetcher to process images in a background queue instead of the main queue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants