Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Disk Fetch in background? #20

Open
bogardon opened this Issue · 4 comments

3 participants

John Z Wu xiss burg Jon Kean
John Z Wu

Hello,

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

xiss burg

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

John Z Wu

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 ...

xiss burg

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.

Jon Kean

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
Something went wrong with that request. Please try again.