w3c / w3c/resource-timing

For all resources, add timestamp of when it was available to the browser

Open
#60 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Bikeshed
Stars
135
Forks
40
PR merge metrics
No merged PRs in 30d

Description

What happens

There are cases when a resource fetched over the network has completed downloading, and is available to the browser, but the browser is too busy to read it and parse it. In these cases, the responseStart timestamp is set after the browser becomes free to read the file off its buffer. This incorrectly points to a network problem.

Example

As an example, using WebPageTest, we measured the loading of a particular website, and also captured the network PCAP file of the data transfer. The PCAP file showed that the file had been fetched (all packets arrived at destination) in under 200ms, however the browser reported responseStart at the 1.2second mark. WPT showed that the browser was at 100% CPU utilization and 0% bandwidth utilization during these 1.2 seconds. This indicated that while the file was available locally in some buffer, the browser was too busy to read it, and incorrectly put the blame on the network.

What we'd like to have

  1. responseStart should stamp when bytes of the response were available, not when the browser was ready to parse them
  2. responseEnd should stamp when the response was completely available, not when the browser finished parsing
  3. Add a new timestamp called loadComplete or resourceLoaded or equivalent, indicating when the browser actually finished handling the resource in a way appropriate for that resource (which might include inserting into the DOM, parsing, executing, etc.)

I believe 1 & 2 are mostly in line with the spec, we should make it explicit that the browser being unable to load, parse and execute an available resource should not delay the responseStart and responseEnd timestamps, and browsers need to follow this.

Source Discussion

This came up as part of the W3C discussion at the Velocity Conference in Santa Clara, CA on 2016-06-22T19:00PDT.

Members in attendance during discussion: (please update list in case I've missed/misspelt anyone)

  • Ryosuke Niwa
  • Ilya Grigorik
  • Philip Tellis

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the Resource Timing behavior described for responseStart and responseEnd, then read the linked source discussion context in this issue. The work is complete only when the timing semantics and the proposed loadComplete or resourceLoaded timestamp have an agreed specification-level definition.

Written by the indexing model from the issue text.

Assessment

Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.