Write HTML Right
Whilst the spec certainly allows you to ignore closing of a whole range of elements, it&#x27;s not necessarily the wisest of choices to make. The parser does actually get slower when you fail to close your tags in my experience.<p>Unscientific stats from a recent project where I noticed it:<p>+ Document is about 50,000 words in size. About 150 words to a paragraph element, on average.<p>+ Converting the entire thing to self-closing p elements added an overhead of about 120ms in Firefox on Linux, before initial render.<p>+ Converting the entire thing to self-closing p elements added an overhead of about 480ms in Chrome on Linux, before initial render.<p>+ Converting the entire thing to self-closing p elements added an overhead of about 400ms in Firefox on Android, before initial render.<p>+ Converting the entire thing to self-closing p elements added an overhead of about 560ms in Chrome on Android, before initial render.<p>+ The time differences appeared to be linearly increasing, as the document grew from 20,000 to 50,000 words.<p>+ Curiously, Quirks Mode also increased the load times by about 250ms on Firefox and 150ms on Chrome. (Tried it just because I was surprised at the massive overhead of removing&#x2F;adding the tag endings.)<p>The most common place this was going to be opened was Chrome on Android, and a whopping half-second slower to first render is going to be noticeable to the end user. For some prettier mark up.<p>Whilst you can debate whether that increased latency actually affects the user, a decreased latency will always make people smile more. So including the end tags is a no-brainer. Feel free to write it without them - but you _might_ consider whether your target is appropriate for you to generate them before you serve up the content.