Live data from Hacker News

Virtual DOM is pure overhead (2018)

svelte.dev

1–10 of 337 posts

Re: Virtual DOM is pure overhead (2018)

#4
Way I remember, the message was that it was too hard for most devs to be careful enough in their Backbone.View.render code to consistently write fast DOM manipulation that scaled. That may not be whats in the cited talk but that's my recall from the various bits of early marketing by Facebook Engineering. So the sell was alievating that burden.

Re: Virtual DOM is pure overhead (2018)

#7
post #2

So is the JS runtime. So why don't we just write apps in raw WASM?

Serious answer? SEO and accessibility. HTML lets search engines crawl pages and screen readers read pages (which can often be a legal requirement).

If we're rethinking the web stack I'd advocate for htmx with wasm-based web components for more complicated stuff like if you needed to polyfil in some new image format, or run a terminal emulator, or do webrtc calls with your own fancy custom noise reduction algorithm.

Yes I realize I'm essentially advocating for jquery with java applets, but it could really work this time! (I think a lot of the issues originally were political)

Make htmx like attributes part of the HTML spec, keep working on web components. Still don't know why web components haven't taken off.

Re: Virtual DOM is pure overhead (2018)

#10
I like the looks of Svelte, but this argument is a bit strong. The supposed benefit of virtual DOM being:

X application-level virtual DOM changes -> differ detects only Y Y final DOM operations

is faster than

X application-level virtual DOM changes -> no virtual DOM diffing -> X DOM operations

this depends a lot of how fast the diffing is and how fast the DOM is but unless DOM operations are instant now (and with CSS, layout reflow, etc. I'm not sure how they could be) then there must remain some situations where VDOM has a perf advantage.

Post reply on HN