3 ms·
That hasn't been true for many years — see e.g. https://segdeha.com/experiments/innerhtml/ https://segdeha.com/experiments/innerhtml/ for the Firefox 3 / Safari
by acdha 7y ago
That hasn't been true for many years — see e.g. https://segdeha.com/experiments/innerhtml/ https://segdeha.com/experiments/innerhtml/ for the Firefox 3 / Safari 4 era — and when it was, it was only in the case where you were blasting out huge amounts of changes at a time. For anything less than a complete rewrite of a large DOM hierarchy it was almost always faster just to update the elements in question using the DOM.
As an example, there was a lot of cargo cult performance discussion around React in the first few years. A coworker was really excited about it but the first time we did a benchmark for code which updated a report table, React was 5 orders of magnitude slower because it used innerHTML instead of the DOM and even with keyed updates that was doing tons of extra work.