Will there be a performance advantage in removing from the DOM and reducing its size?
As for DOM performance, as a rule, the less you interact with the DOM, the better.
Remember that your selectors intersect dom, so if you use an inefficient selector, it will be poor performance, no matter what, but if you select elements by identifier and not by class or attribute, where possible, you can compress good performance pages, regardless of whether you deleted these extraneous markup elements.
When the page was originally submitted, it contains many DOM elements that contain json strings that I entered on the page .... For information, these elements are about 500 thousand in size ..
In terms of page loading, your performance suffers from having to transfer all this data. if you can find a json-only transfer method this can only help. Removing after the fact will not solve this particular problem, however.
source share