For anyone that doesn't already know this, Xenforo is verrrry syntactical and nested in its markup, perhaps overly so if looking at it from an optimization standpoint. For example, take the following:
HTML:
<div class="block">
<div class="block-container">
<div class="block-row block-body">
<div class="contentRow">
<div class="contentRow-main">
<div class="contentRow-title">Hello</div>
<div class="contentRow-snippet">Test test..</div>
</div>
</div>
</div>
</div>
</div>
It takes 5 nested elements just to get to the content. The benefit of this is that Xenforo as a whole establishes core rules and syntax to follow and repeat for virtually any structural need, and most addon developers follow these rules in their products.
The benefit is that both core and community code is very predictable, recognizable and readable from a syntax standpoint, and makes working in Xenforo very easy once you learn it. Compared to other platforms such as Wordpress, where it's the Wild West and nearly any theme or plugin you install will be alien in its approach.
The downside is that this produces very heavy page structure, especially when elements are repeated many times in say a grid, list or sidebar.
For this reason Xenforo usually gets flagged by PageSpeed Insights or GTMetrix for having excessive DOM size (amount of HTML). There's very little you can do about this for core XF & addons.
What you can do is when dealing with Page nodes, where you write your own HTML or embed custom widgets. Try to write as efficient HTML as possible, and minimize use of repeating elements.
For example, a client of mine had a homepage using a custom Page node. It had grids of "Most recent threads", "Most recent posts", "Most recent products" etc. We scrapped a few of these sections and reduced the visible items in the others from 10 to 4. This cut down on the DOM size by a large amount. Remember that past what you are
adding to Xenforo (via pages, widgets, etc), you cannot go
further in reducing DOM. XF is what it is.