DEV Community

Discussion on: Virtual DOM - The backbone of React

Collapse
 
vitalcog profile image
Chad Windham

Firstly, great write up!
Secondly, is it possible to go into more depth on the better performance of the virtual dom?

"Virtual DOM in it's core sense is just a Javascript object which contains a list of nodes that have to be rendered in the real DOM and updating the values in this Javascript object is much faster compared to updating the actual DOM tree.

Basically, if DOM is the actual building then Virtual DOM is the blueprint of the building. The core idea is it's always easy and fast to modify the blueprint than the real building."

I'm asking because there is an obvious gap inside of my mind as to how this improves performance. Yes it is easier to update the blueprints, but this also leads to the DOM itself changing. Often times in these scenarios there are several small changes occurring steadily and rapidly. Is an end user actually seeing the virtual dom the whole time?