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

Disk Fetch in background? #20

Open
bogardon opened this issue Feb 21, 2012 · 4 comments
Open

Disk Fetch in background? #20

bogardon opened this issue Feb 21, 2012 · 4 comments

Comments

@bogardon
Copy link

Hello,

Is there any plans to defer disk fetch into a background thread/queue? This would help scrolling performance tremendously.

@xissburg
Copy link

Can't you do that using a dispatch_async in tableView:cellForRowAtIndexPath: ? It might work out.

@bogardon
Copy link
Author

I assume you mean call setImageURL inside a dispatch_async(dispatch_get_global_queue....) type thing.

if setImageURL fires a network request instead of a diskfetch, the image will never be downloaded.

However, if setImageURL does a disk fetch, AND you call setNeedsDisplay in imageViewDidLoad, this would work.

I was looking for a more built in solution, possibly with the ability to cancel a disk fetch? though that is not likely.

Also, using DISPATCH_QUEUE_PRIORITY_LOW is still pretty laggy for scrolling. Ideally, we would want to use DISPATCH_QUEUE_PRIORITY_BACKGROUND, but this constant is only available for iOS 5.0 ...

@xissburg
Copy link

After looking into - [EGOImageView setImageURL:]I noticed that it does everything there inside, like setting the image for the imageView which should be done in the mainThread, so you must not call this method in another thread. You'll have to modify the code to support this. Perhaps you can create another method that does the async stuff inside of it, or you can add a flag to the setImageURL: that allows you to choose whether you want set the image a/synchronously.

@ghost
Copy link

ghost commented Dec 10, 2012

I ran into this, and resolved it by serially loading images off the main thread (see my branch). scrolling while loading is then smooth and works well.

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

No branches or pull requests

2 participants