Question

Does invalid html slow down a page load or the invalid html has no effect on page load time? Is there a way to test it accurately?

Was it helpful?

Solution

If anything, it will not be slower than a single animation in jQuery. Most of your javascript will take significantly more amount of time than invalid html (uSeconds of difference!!!) so in reality, i am sure you will not see an effect and the end time user will not see an effect.

If your software is mission critical and needs to be displayed as fast as possible then yes, anytime a browser cannot configure your html and has to guess, it requires extra operations, and possibily thousands of computer ops (1 ms). So in reality your probably fine, if not write better html by validating it

OTHER TIPS

Well, I don't know the answer, one would say it is probably slowing the page down if the browser has to guess what the correct rendering should be, but anyway browsers are great doing that, so probably the difference is not that big. On the other hand, there are certain things that can slow your rendering and are not due to incorrect html, an example of this can be the location of the tags in the page.

I don't know for other browsers, but Chrome has Speed Tracer, you can use it to measure how much time is spent by the browser on each of the stages of the page rendering.

Different browsers will handle it in different ways and I suspect it's pretty hard to test.

Missing elements like - - will result in the browser guessing the charset and can lead to duplicate downloads

I don't think missing html can cause slowing the page down, as per most browsers can guess what the tag would be, except it's written in php then. but mostly what can slow down a page would be incorrect javascript or too much of using inline javascript instead of external.I have experience something like this and frankly am not sure missing tags can slow down your pages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top