2

I am trying to understand and quantify the amount of time the browser spent on parsing HTML. I guess parsing here also includes the step of building out the DOM tree.

I made a simple node server that serves a plain HTML with no script tags/inline JS. It only has some text nodes in the <body /> . I served it locally and access it from Chrome. I took a look at the performance tab, it shows that the "Parse HTML" took about 59.80 ms and it seems to include evaluate scripts which I found odd since I don't have any scripts inside my HTML.

enter image description here

However in Summary section below, "Loading" is 3ms. I found that in this post it seems like "Loading" is including the parsing of HTML. In other words the parsing of HTML actually took less than 3ms, which is more in line with my expectation since the HTML itself is really minimal.

So my question is, which one here is the actual time the browser took to parse the HTML?

Also my assumptions about web development in general is that, compared to the amount of the time downloading HTML (server response time + network roundtrip time), the parsing of HTML is really fast. Is this assumption generally true?

Joji
  • 4,703
  • 7
  • 41
  • 86
  • Are you asking to find it programmatically? – Spectric Jun 05 '22 at 02:17
  • @Spectric either way, I don't care if it has to be programmatical. But I think we should be able to tell with chrome devtool? – Joji Jun 05 '22 at 02:21
  • Do you have any extensions? – Daniel A. White Jun 05 '22 at 02:22
  • No scripts, huh? Please [edit your question](https://stackoverflow.com/posts/72504340/edit) to show the complete HTML source of your page as received by the browser. – kmoser Jun 05 '22 at 03:11
  • just realize I had this chrome-extension `testing-library.js` so I guess the long parsing time was caused by this extension? But still why is that the Loading in summary so much shorter? – Joji Jun 05 '22 at 04:54

0 Answers0