Re:Chrome Never-Slow Mode Prototype
by Someone1234 on Tuesday February 05, 2019 @02:32PM
(#19088867)
That's really cool. The only thing missing is the total number of DOM elements on a page. I've seen production sites with literally thousands, and it slows most browsers to a crawl (and balloons memory).
[ Parent
| on HN ]
This comments page has over 1194 elements on it right now, with only 34 comments. Thousands is peanuts.
If the issue of too many DOM elements is memory use, wouldn't it be better to just limit the memory use of a page?
Apologies if this is a really ignorant question as I know very little about browsers/front end development.
It's more than memory use - it causes tree traversals to take longer, which means unbounded style recalculations (common) and side-effecting DOM changes take longer.
There are legit uses of RAM, fully fledged web apps are ordinary now
Thousands isn’t really a whole lot. If you have say a table with 10 columns and 50 rows and have complex content in the cells (including div elements) you’ll be well into the thousands.