当前位置:网站首页>Native DOM vs. virtual DOM
Native DOM vs. virtual DOM
2022-06-26 01:09:00 【Nanchu】
- First , We need to figure out two concepts , What is primordial dom, What is virtual dom?
- Traditional development model
- Native JS or JS operation DOM when , The browser will build DOM The tree starts the process from the beginning to the end .
- In one operation , I need to update 10 individual DOM node , The browser receives the first DOM I didn't know there was 9 Update operations , So the process will be executed immediately , Final execution 10 Time .
- fictitious DOM
- Web The interface consists of DOM Trees ( Tree means data structure ) To build , When part of it changes , In fact, it corresponds to a DOM The node has changed .
- In one operation 10 Secondary update DOM The action of , fictitious DOM No immediate action DOM, It's about putting 10 Updated diff Save the content to a local JS In the object , In the end JS Object one time attch To DOM on the tree , Follow up , Avoid a lot of unnecessary calculations .
- fictitious DOM The benefits of
- use JS Object simulation DOM The benefits of nodes are , The update of the page can be reflected in JS object ( fictitious DOM) On , Operate... In memory JS Objects are obviously faster , After the update is completed , And finally JS Objects are mapped to real DOM, It's up to the browser to draw .
边栏推荐
猜你喜欢
随机推荐
Redis之Strings命令
Phoenix index
信息收集的利器,Google骇客语法
Musk vs. jobs, who is the greatest entrepreneur in the 21st century
Unified gateway
Classic interview questions: mouse drug test and Hamming code
Web信息收集,互联网上的裸奔者
ASP.NET cache缓存的用法
数据分析——切片器、数据透视表与数据透视图(职场必备)
Leetcode 513. Find the value in the lower left corner of the tree
填鸭数据即时收集解决方案资源
C#另外一个new类的方式Ico?以及App.config的使用
Qt Cmake 纯C 代码调用系统控制台输入scanf 及 中文输出乱码
新库上线 | CnOpenData农产品批发价格数据
计算机网络知识总结(面试)
Online gadget sharing (updated from time to time, current quantity: 2)
Binary sort tree
Optimized three-dimensional space positioning method and its fast implementation in C language
Music spectrum display toy -- implementation and application of FFT in stm32
ETCD数据库源码分析——集群通信初始化









