Page MenuHomePhabricator

Add metric to measure time between early click and replayed click
Closed, ResolvedPublic

Description

Migrated from: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/515

Narrative

On a slow connection, this can take a while

Related Stories

#508

Related Changesets

Event Timeline

MingleTerminator raised the priority of this task from to Low.
MingleTerminator added a project: Multimedia.
In mingle on 2014-04-26 at 01:42:21, @Tgr wrote:

While this would be useful, what I had in mind is a different problem. This is (I think) what happens on an 1 Mbps connection on a page containing a lot of thumbnails:

  • you open the page
  • the browser finishes loading the HTML/JS/CSS in 3-4 seconds; it puts all the thumbnails it encountered in the HTML source into some sort of internal queue, and starts loading them. Loading takes 2-300 ms per thumbnail; there is some amount of parallelism, but it is limited by the same-domain connection cap (typically 6 for modern browsers).
  • the user clicks on an image at, say, 5 sec after opening the page. At this point the domready event has already fired, mmv.bootstrap is fully loaded, there is no replaying needed. Since the domready already happened, and the browser shows the top of the page with the first couple of thumbnails, and those have already loaded, the user's impression is that the page is fully loaded - he does not see any changes, he does not see a hourglass cursor, all the image loading that is still happening is happening below the fold.
  • MediaViewer displays a black overlay and starts loading the large thumbnail for the clicked image, via AJAX or a dynamic <img> tag. That thumbnail request goes to the end of the browser's internal queue.
  • lot of time passes (20-30 sec) while the browser goes through the queue. The user is staring at the placeholder.
  • the actual thumbnail is loaded. This is slow but would be a lot less slow without the waiting (takes ~10 sec).

So the time between the click and MediaViewer being ready to handle it can well be zero; the time between the click and all images on the page finishing loading (onload event) is around 30 sec and makes up the majority of the click-to-display time.

In mingle on 2014-04-28 at 13:28:08, @Gilles wrote:

The scenario you describe will be measured by #508 .