Re:Removing User Interface Complexity, or Why React is Awesome
by rjknight on Tuesday May 13, 2014 @11:30AM
(#7738607)
I may be mistaken here, but I think that the main advantage of the virtual DOM is to avoid calling across the JavaScript-native boundary. Since calling browser APIs is inherently expensive, the virtual DOM improves performance by reducing the number of calls to these APIs and/or batching them together.
Similar techniques have been used in other types of programs where performance is critical - for instance, user mode networking and user-mode thread scheduling can be quicker than the kernel-mode equivalent because it reduces or eliminates expensive system calls.
Re:Removing User Interface Complexity, or Why React is Awesome
by rdtsc on Tuesday May 13, 2014 @11:04AM
(#7738473)
Yeah if the technology was in the browser that would possible.
From what I understand, the core idea is that changes are applied to the virtual DOM in a very simple way (from the application point of view). Then there is another piece of code that knows how to efficiently find the diff between the vDOM and DOM and apply the changes. It seems that last part could be done by the browser.
P.S. I haven't looked into this in depth, just throwing an idea out there.