I feel like nobody is asking: what is the point of all this performance chasing with frontend frameworks? You might get a millisecond here or there. So what? In my experience it has never, ever been the JS rendering layer which has caused unresponsiveness in an application. It's almost always some type of network communication issue, be it the database stalling or static assets not being served. Where JS rendering mi…
Virtual DOM is pure overhead (2018)
51–60 of 293 posts
Re: Virtual DOM is pure overhead (2018)
#52I feel like nobody is asking: what is the point of all this performance chasing with frontend frameworks? You might get a millisecond here or there. So what? In my experience it has never, ever been the JS rendering layer which has caused unresponsiveness in an application. It's almost always some type of network communication issue, be it the database stalling or static assets not being served. Where JS rendering mi…
I am currently working with low-latency audio and the latency requirements mean I have minimal buffering. While the VDOM render cycle is generally fast enough to be unnoticeable to the user, it stalls the audio buffering just enough to cause some stalling. There's a few heavier parts of the application where the rendering is expensive enough to briefly stall animations as well.
While both of these issues are something we need to fix, it is specifically the rendering/vdom process that we need to work around to address these performance concerns, and we are definitely not at all Facebook.
Re: Virtual DOM is pure overhead (2018)
#53I personally love the idea of the VDOM, because it liberates the content from being stuck to one document type: HyperText. While true when VDOM showed up on the scene, Facebook and others said the VDOM would help cure performance issues and that was the main selling point.. as we see now with things like ReactPixi, and Netflix using React for some of their apps - the VDOM is infinitely valuable for transcending the limits of HyperText and instead abstracting it away so that content may be projected by any sort of renderer using the same scaffolding as web pages. If you code to just the DOM - that is is where you will stay. Forever.
Re: Virtual DOM is pure overhead (2018)
#54I feel like nobody is asking: what is the point of all this performance chasing with frontend frameworks? You might get a millisecond here or there. So what? In my experience it has never, ever been the JS rendering layer which has caused unresponsiveness in an application. It's almost always some type of network communication issue, be it the database stalling or static assets not being served. Where JS rendering mi…
Svelte (and some other contenders, like concurrent mode React) improve performance enough that interactive animated datavis stuff can also be done declaratively.
Re: Virtual DOM is pure overhead (2018)
#55Svelte does something interesting in an innovative way. However, this article is overly focused on just one element of how React works. If your app is spending a significant amount of time doing virtual DOM diffs, then sure. The virtual DOM overhead is a problem. However, saying it’s pure overhead and then not qualifying how much is a catastrophic failure of reasoning. Their alternative is to add more complex compile…
The part that I think the article misses is that VDOM is just an implementation detail of React. No one actually really cares about it, and its not the reason why people use React.
Re: Virtual DOM is pure overhead (2018)
#56Re: Virtual DOM is pure overhead (2018)
#57I have in my head a few dozen examples of what I mean, some small and some large. I won't even get into TCP/UDP which has already been argued over a thousand times. But I would point to RINA and other paradigms of remote execution:
https://en.wikipedia.org/wiki/Recursive_Internetwork_Archite...
But that's the large scale stuff. We can also focus on very minor stuff where a different design decision might have lead to less trouble. Take, for instance, a mouseclick. Which element on a Web page should receive that mouseclick? Well, there is a well-established hierarchy that the browsers respect, walking up the DOM, checking each element to see if it has a handler registered. It can be a royal pain if your application needs you to break out of that hierarchy, and you can end up with something buggy because this is still an area where the different browsers have slight differences. But why should any hierarchy exist by default? We could have it such that there is no hierarchy by default, the only hierarchy is that which is defined by me, the programmer. I believe this original decision (of a default hierarchy) was made because there was an assumption, in the 1990s, that each page would be hand-coded, but nowadays we have frameworks that write much of our Javascript for us, so the possibility of assigning mouseclick handlers on the basis of classes, rather than the DOM, seems like a smart choice now, but probably didn't in the 1990s.
I tried to write about some of this in essays like "The problem with HTML":
http://www.smashcompany.com/technology/the-problem-with-html
and also, "HTML is the failed GUI for TCP/IP":
http://www.smashcompany.com/technology/html-is-the-failed-gu...
I'm not sure I really communicated myself very well previously, but perhaps if I focus on it, I can build the case that we've been following a path into a dark wood, and we've been so busy focusing on the path one step before us that we have perhaps not noticed that we've wandered into the lands where, in innocent days of yore, developers would have warned, "There be dragons, do not go."
Re: Virtual DOM is pure overhead (2018)
#58For 95% of apps, Svelte's custom syntax is pure cognitive overhead making little difference to the performance of the app.
This, that's why React was a bit revolutionary at its time. No customized template dsl. Just speak JS.
Not saying that Angular's banana box is ideologically superior, just that all JS frameworks have idiosyncrasies.
Re: Virtual DOM is pure overhead (2018)
#59I will probably get downvoted as I am in minority who still believe Server Side Rendering is the best approach for most of the web with exceptions to some websites that require Single Page App functionality. I still think web would be best if you do SSR and then replace HTML DOM elements using frameworks like Stimulus Reflex or Hotwire. For millisecond interactivity you may want to write JS in a framework like Stimul…
Re: Virtual DOM is pure overhead (2018)
#60they say they dislike complexity
but look at what they do
not at what they say
is it for fear of appearing insufficiently intelligent?