Walking through the DOM is slow
See original GitHub issueYou state that walking through the DOM isn’t slow, but in reality it really is. Accessing things like firstNode or childNodes is vastly slower than storing a light-weight representation of it (aka virtual DOM).
Furthermore, handling of keyed nodes becomes problematic when using DOM nodes. There simply isn’t any performant way of doing this when using the DOM as the source-of-truth.
Have you see this too? http://vdom-benchmark.github.io/vdom-benchmark/
Furthermore, you shouldn’t really be comparing yourself to the virtual-dom
library and stating that library as the de-facto virtual DOM standard, it’s one of the slowest implementations of virtual DOM out there in Safari (it’s noticeably faster than morphdom in Chrome according to your own benchmark).
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:20 (5 by maintainers)
Top GitHub Comments
For context, this library is at the core of Phoenix Live View (LiveWire for Laravel). Total diff is much smaller than equivalent SPA apps since users server side render their page and sprinkle in small reactive parts into page. This makes this library a perfect candidate since v-dom only wins once I/O is swamped (due to large changes). Otherwise real DOM is better/on par with v-dom.
https://github.com/phoenixframework/phoenix_live_view
Not much changed. Real DOM complexity slowness is inherent in its design, so it cannot be really faster. trueadm now works on React. But React raw speed in 5 years improved only very slightly, it is not goal really. Worst IE you need to support is IE11, much better than IE8 or IE9, but still crap.