An Optimized Diff Algorithm Based on Myers

Virtual DOM technology is the key to efficient rendering of modern front-end frameworks (such as Vue, React), and its performance largely depends on the efficiency of Diff algorithm when comparing and updating new and old virtual nodes. Vue2 uses Diff algorithm based on tree structure, but with the increase of application scale, the current Diff algorithm has performance bottleneck when dealing with complex UI updates and large-scale nodes. To solve this problem, this paper proposes an optimized Diff algorithm based on Myers algorithm to improve the comparative performance of virtual DOM in Vue2 framework. The optimization scheme of this paper combines the minimum editing distance calculation method of Myers algorithm and virtual DOM tree structure, and reduces unnecessary node comparison through multi-level segmentation and difference point prediction mechanism. In addition, a jump strategy is designed to speed up the Diff process in frequent UI update scenarios.

Authors

Institutions

Publication Details

Published
2024-12-13
DOI
https://doi.org/10.1109/iccc62609.2024.10941841
Primary Topic
Neural Networks and Applications
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

An Optimized Diff Algorithm Based on Myers

S.J. Wan, Zhao-Huan Yu, Yihao Qin, Yu Xin et al.
Neural Networks and Applications
article

An Optimized Diff Algorithm Based on Myers

S.J. Wan, Zhao-Huan Yu, Yihao Qin, Yu Xin, Huimei Huang
article en

Abstract

Virtual DOM technology is the key to efficient rendering of modern front-end frameworks (such as Vue, React), and its performance largely depends on the efficiency of Diff algorithm when comparing and updating new and old virtual nodes. Vue2 uses Diff algorithm based on tree structure, but with the increase of application scale, the current Diff algorithm has performance bottleneck when dealing with complex UI updates and large-scale nodes. To solve this problem, this paper proposes an optimized Diff algorithm based on Myers algorithm to improve the comparative performance of virtual DOM in Vue2 framework. The optimization scheme of this paper combines the minimum editing distance calculation method of Myers algorithm and virtual DOM tree structure, and reduces unnecessary node comparison through multi-level segmentation and difference point prediction mechanism. In addition, a jump strategy is designed to speed up the Diff process in frequent UI update scenarios.

Huaibei Normal University (CN), Shenyang Institute of Computing Technology (China) (CN), University of Chinese Academy of Sciences (CN)
Openalex Percentile: Top 74%
Neural Networks and Applications
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.