Page MenuHomePhabricator

Saving article with lots of images appears to block loading of subsequent articles (until images fetched?)
Closed, InvalidPublic

Description

Probably need a spike to investigate this.

Repro:

  • Open an article and tap save on the bottom toolbar
  • Now tap a link
  • When that new article opens, tap save
  • Repeat the a few times, as I did with the following:

Screen Shot 2016-11-21 at 4.55.43 PM.png (1×974 px, 286 KB)

The issue I'm seeing is, after tapping the save button, then tapping the link, the link's article hangs for a long time. It appears this hanging is dependent on how many images the saved article had. As soon as the console stops showing "SDWebImageManager" messages the article appears, but many articles have dozens if not 100+ images so the hang time can be quite long.

Noticed this while browsing on a wifi network, iOS 10.1 iPhone 6s sim.

Tap for animation:

delay.mov.gif (720×396 px, 4 MB)

Event Timeline

@JMinor Potentially need a quick-ish fix for this if others can repro...

Mhurd updated the task description. (Show Details)

This might be a connection issue? I saved the same series of articles, and then clicked through from Europe articles to several others and all loaded correctly. Maybe I'm missing a step?

@JMinor I uploaded a gif. It seems like the saved images fetches are happening on the main thread (from the symptoms) but I haven't had time to confirm.

I've definitely seen this before - I think it has to do with the max concurrent operation count on the image loading queue. We should investigate setting separate queues (or adjusting queue priority) to ensure images loaded from the foreground aren't blocking those downloading in the background.

@JMinor But ya you may be right about it being connection dependent. I can try again when I'm back tomorrow on a dif network. I'm on wifi here and it seems snappy... speed test said 6Mbps... so not blazing...

@JoeWalsh oh cool that may be a pretty easy fix

JMinor raised the priority of this task from Low to Medium.Dec 5 2016, 7:52 PM

Potentially adopt lazy loading of images as a solution.

I'd be wary of working on lazy loading until we know what's going on.

Probably close this, but need to double check that this is not an issue anymore.

Will also be changed again by SDWebImages changes, so closing this.