计算机应用与软件2017,Vol.34Issue(12):21-25,31,6.DOI:10.3969/j.issn.1000-386x.2017.12.004
基于虚拟DOM的Web前端性能优化研究
RESEARCH OF OPTIMIZATION FOR WEB FRONT-END PERFORMANCE BASED ON VIRTUAL DOM
摘要
Abstract
With the constant development of the web front-end,web page has become more complex.Strong interaction leads to a crazy rise in page status.DOM operation for updating the page will also increase.However,frequent DOM operation makes slow page rendering,resulting in front-end performance bottlenecks.Therefore,based on the analysis of the causes of this problem,a method of optimizing DOM operation by virtual DOM and Diff algorithm was introduced.Moreover,by analyzing the traditional Tree-Diff and DOM-Diff algorithm,the existing Diff algorithm was improved.Finally,a test platform was built to test the rendering performance of the improved algorithm (Virtual-DOM),ReactJS and native JS,and the test results were compared and analyzed.The experimental results show that the virtual DOM can really optimize the rendering performance of the browser.And in certain circumstances,the improved DOMDiff algorithm is better than ReactJS.关键词
Web前端性能优化/虚拟DOM/Diff算法/ReactJSKey words
Web front-end performance optimization/Virtual DOM/Diff algorithm/ReactJS分类
信息技术与安全科学引用本文复制引用
戴志诚,程劲草..基于虚拟DOM的Web前端性能优化研究[J].计算机应用与软件,2017,34(12):21-25,31,6.基金项目
国家科技支撑计划子课题(2015BAH33F0202). (2015BAH33F0202)