New issue
Advanced search Search tips

Issue 653518 link

Starred by 3 users

Issue metadata

Status: Archived
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

Resource timings API sometimes includes JavaScript eval of previous scripts for cached assets

Reported by sam.saff...@gmail.com, Oct 6 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

Steps to reproduce the problem:
Visit https://meta.discourse.org twice
Look in network tab
application js is correctly cached yet "Content Download" is 380ms

What is the expected behavior?
Cached assets should have "content download" of 0 or whatever the time is to fetch the data from the browser cache. 

What went wrong?
It potentially includes eval time of previous scripts

Did this work before? N/A 

Chrome version: 53.0.2785.116  Channel: n/a
OS Version: OS X 10.12.0
Flash Version: Shockwave Flash 23.0 r0

script evaluation time is an important metric, but resource timings does not provide a clean way of digging at it, Firefox cleanly eliminates this from the equation.

Current behaviour makes it very hard to interpret results of resource timings.
 
why.png
258 KB View Download
answer.png
198 KB View Download
firefox.png
256 KB View Download
Firefox is reporting user-cpu time for the download? I'm not convinced that's a better outcome. It's perfectly reasonable for a download to be blocked for any number of the reasons (network packets, local IPC overhead, cache overhead, etc.) and I think it makes sense to report download time as wall-clock time.
This actually runs quite deep into the resource timings api... 

When resource is cached locally and served from local cache: 

connectEnd : 0
connectStart : 0
domainLookupEnd : 0
domainLookupStart : 0
duration : 102.95000000000002
entryType : "resource"
fetchStart : 193.24500000000003
initiatorType : "script"
name : "https://cdn-enterprise.discourse.org/docker/assets/application-e9fbecdbabe02bc165f936440a81e71ebc335c16ecb9f430d856760cdcbe5863.js"
redirectEnd : 0
redirectStart : 0
requestStart : 0
responseEnd : 296.19500000000005
responseStart : 0
secureConnectionStart : 0
startTime : 193.24500000000003
workerStart : 0

When resource is uncached and fetched from network:

connectEnd : 0
connectStart : 0
domainLookupEnd : 0
domainLookupStart : 0
duration : 1380.585
entryType : "resource"
fetchStart : 842.705
initiatorType : "script"
name : "https://cdn-enterprise.discourse.org/docker/assets/application-e9fbecdbabe02bc165f936440a81e71ebc335c16ecb9f430d856760cdcbe5863.js"
redirectEnd : 0
redirectStart : 0
requestStart : 0
responseEnd : 2223.29
responseStart : 0
secureConnectionStart : 0
startTime : 842.705
workerStart : 0

So when implementing resource timing metrics we are stuck with no way of telling if a resource was cached locally or not, neither is there any way of properly deciphering network cost. 
I guess some of this will be much more workable once https://developer.mozilla.org/en-US/docs/Web/API/PerformanceResourceTiming/transferSize is implemented :( 
Cc: igrigo...@chromium.org
> So when implementing resource timing metrics we are stuck with no way of telling if a resource was cached locally or not, neither is there any way of properly deciphering network cost. 

This seems orthogonal to the original bug...? That said, RT size attributes are shipping in M54: https://www.chromestatus.com/feature/6549060404117504

Comment 5 by alph@chromium.org, Oct 10 2016

Cc: paulir...@chromium.org
Owner: allada@chromium.org
Status: Assigned (was: Unconfirmed)
Owner: ----
Status: Archived (was: Assigned)

Sign in to add a comment