Performance · DOM
Excessive DOM size
This page has more than 1,600 elements, because a grid below holds 1,500 small squares. Large DOMs slow down styling, layout and interaction.
How this page is built
The grid below has 30 rows of 50 squares, each square an empty span. Together with the rest of the page, that gives more than 1,600 elements. No single element has more than 50 children, and the grid is only three levels deep, so the page is large but not too wide or too deep.
Why it matters
Every element in the page has to be styled, laid out and painted, and kept in memory. Above about 1,400 elements, the browser does noticeably more work each time something changes, which slows down interaction and can hurt Interaction to Next Paint.
Large DOMs usually come from long lists rendered all at once, deeply nested layout wrappers, hidden menus and carousels, or pages built by tools that add many extra elements.
How to check it
Run Lighthouse or PageSpeed Insights on the page and look at the diagnostics. Crawl tools that run Lighthouse for each page, or that measure page resources, report the same finding across the site. Lighthouse reports the total number of elements, the deepest element and the element with the most children. In the browser console, document.querySelectorAll('*').length gives the count.
How to fix it
Remove wrapper elements that do nothing, render long lists in pages or as visitors scroll, and load hidden content such as large menus only when it is needed.