3 ms·
To my understanding, the virtual DOM used for efficient "diffing" of the subtrees - i.e. producing the optimal set of DOM updates required. If you are building
by supermatt 4y ago
To my understanding, the virtual DOM used for efficient "diffing" of the subtrees - i.e. producing the optimal set of DOM updates required.
If you are building any abstraction on top of the DOM to handle that, then you have effectively built a virtual DOM.
Or are you suggesting that setting innerHTML and allowing the browser to re-construct the DOM is now faster? I can assure you that is not the case!
- jesse__ 4y agoLook at their benchmarks. They compare against innerHTML and against (I assume) inserting new DOM nodes. Million is slightly faster than the former, slightly slower than the latter. DOM manipulations are fast these days
- supermatt 4y agoWow, im surprised at how fast that is now - although the benchmarks themselves are doing bulk ops for all the innerHTML stuff, so it will lose some UI state (cursor, etc) TBH, looking at the benchmark code for partial updates, im not sure I have much faith in the benchmarks overall, but certainly eye-opening regarding the innerHTML performance.
- jesse__ 4y agoYeah I was surprised at the numbers too. I'm wondering if those numbers actually imply that reconstructing the Dom from scratch every update is now faster than using a VDom..?