Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I also blame browsers. Create an empty .html file and open it in firefox. Load time 370 ms (according to an addon). It's a local empty file. How can firefox spend 234 ms on DOM processing? Chrome seems to be better here.

Edit: window.performance.timing.domContentLoadedEventEnd - window.performance.timing.navigationStart

Firefox: 411

Chrome: 70 => better, but still 70ms for what?



I get 66ms on Firefox, with the following breakdown:

    navigationStart: 0
    fetchStart: 0
    domainLookupStart: 35
    domainLookupEnd: 35
    connectStart: 35
    connectEnd: 35
    requestStart: 36
    responseStart: 36
    responseEnd: 36
    unloadEventStart: 49
    unloadEventEnd: 49
    domLoading: 49
    domInteractive: 63
    domContentLoadedEventStart: 64
    domContentLoadedEventEnd: 65
    domComplete: 66
    loadEventStart: 66
    loadEventEnd: 66
So it looks like the bulk of the time is actually whatever happens between fetchStart and domainLookupStart, and between responseEnd and unloadEventStart. The actual time from domLoading to domComplete is only 17ms, which is about 1 frame on a 60hz monitor.

Note: refreshing the page with the javascript console open takes ~200ms on my machine, and certain extensions can make it even slower than that.


There is no "empty .html file" in the browser. It's not just a text file, it's a document tree; there are compulsory nodes that need to be created even if you didn't explicitly write them in your file. <html>, <head> (which must contain <title>) and <body> need to exist - and since you didn't create them, the browser must, after it's failed to parse what you were supposed to have included.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: