Tag

Diff Algorithm

0 views collected around this technical thread.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Nov 10, 2024 · Frontend Development

Why Not Use :key="index" in Vue v-for? Understanding Virtual DOM and Diff Algorithm

This article explains why using :key="index" in Vue v-for loops is problematic, describes the virtual DOM compilation process, demonstrates the diff algorithm with examples, and provides best practices for key usage to improve rendering performance.

Diff AlgorithmVirtual DOMVue
0 likes · 6 min read
Why Not Use :key="index" in Vue v-for? Understanding Virtual DOM and Diff Algorithm
Tencent Cloud Developer
Tencent Cloud Developer
Apr 17, 2024 · Mobile Development

QQ 9 Performance Optimization: Technical Implementation Behind the "Silky Smooth" Experience

QQ 9 achieves a “silky smooth” experience by cutting launch time 40% through lazy‑loaded libraries and main‑thread priority tweaks, boosting runtime fluidity with an NT Kernel that offloads logic, incremental diff refreshes and parallel layout, and adding the Hodor anti‑degradation system, delivering 35% smoother performance and 48% less lag.

Android OptimizationAsync LayoutDiff Algorithm
0 likes · 20 min read
QQ 9 Performance Optimization: Technical Implementation Behind the "Silky Smooth" Experience
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Oct 14, 2023 · Frontend Development

Understanding Vue's Diff Algorithm: A Step‑by‑Step Guide

This article explains Vue's diff algorithm in detail, covering prerequisite concepts about VNode, left‑ and right‑side comparisons, handling arrays of different lengths, and the complete implementation with code examples to help developers grasp how Vue efficiently updates the DOM.

Diff AlgorithmJavaScriptVNode
0 likes · 11 min read
Understanding Vue's Diff Algorithm: A Step‑by‑Step Guide
Tencent Cloud Developer
Tencent Cloud Developer
Jan 6, 2023 · Frontend Development

Understanding Vue's Diff Algorithm: Rules, Implementation, and Optimizations

The article explains Vue’s virtual‑node diff algorithm, detailing depth‑first traversal, head‑tail pointer comparisons, an index‑map for moved nodes, post‑traversal addition/removal handling, and Vue 3’s static‑vnode optimization, showing how these techniques achieve efficient O(n) DOM updates.

Diff AlgorithmJavaScriptVirtual DOM
0 likes · 6 min read
Understanding Vue's Diff Algorithm: Rules, Implementation, and Optimizations
政采云技术
政采云技术
Nov 15, 2022 · Fundamentals

Understanding How Git Works: Objects, Branches, Merges, and the Myers Diff Algorithm

This article explains the internal mechanics of Git, covering its distributed nature, object model (commits, trees, blobs), branch creation, merging strategies, conflict resolution, and the Myers algorithm used for diff operations, illustrated with command‑line examples and diagrams.

Diff AlgorithmVersion Controlbranching
0 likes · 19 min read
Understanding How Git Works: Objects, Branches, Merges, and the Myers Diff Algorithm
HelloTech
HelloTech
Oct 9, 2022 · Frontend Development

Understanding Vue2 and Vue3 Diff Algorithms: Core Principles and Process

The article explains how Vue 2’s diff algorithm uses head‑to‑tail comparisons and a key‑to‑index map to patch, add, or remove nodes, while Vue 3 improves efficiency by building a key‑to‑new‑index map, computing the longest increasing subsequence, and moving only non‑LIS nodes, reducing DOM operations.

Diff AlgorithmJavaScriptVirtual DOM
0 likes · 22 min read
Understanding Vue2 and Vue3 Diff Algorithms: Core Principles and Process
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jul 7, 2022 · Frontend Development

Understanding React, Vue2, and Vue3 Diff Algorithms and Why Vue Does Not Use Fiber

This article explains React's Diff algorithm and Fiber architecture, compares it with Vue2 and Vue3's double‑ended diff approaches, and discusses why Vue does not need Fiber or time‑slicing, providing code examples and visual illustrations of the underlying mechanisms.

Diff AlgorithmFiberReact
0 likes · 30 min read
Understanding React, Vue2, and Vue3 Diff Algorithms and Why Vue Does Not Use Fiber
IT Services Circle
IT Services Circle
Apr 17, 2022 · Frontend Development

A 40-line Diff Algorithm Implementation for React's Virtual DOM

This article explains the design and implementation of a minimal 40‑line Diff algorithm for React’s virtual DOM, covering node attribute changes, insertions, deletions, and moves, and provides a complete TypeScript demo that marks nodes with placement or deletion flags for efficient DOM updates.

Diff AlgorithmJavaScriptReact
0 likes · 10 min read
A 40-line Diff Algorithm Implementation for React's Virtual DOM
Shopee Tech Team
Shopee Tech Team
Mar 10, 2022 · Mobile Development

FolderBsdp: An Efficient Incremental Update Solution for React Native Hybrid Apps

FolderBsdp provides an efficient incremental update method for React Native hybrid apps by diffing raw resource folders per file with BSDiff, packaging tiny patches into a single ZIP, dramatically cutting bandwidth, memory usage, and storage while eliminating extra ZIP dependencies, making it ideal for low‑end devices.

Diff AlgorithmFolderBsdpIncremental Update
0 likes · 22 min read
FolderBsdp: An Efficient Incremental Update Solution for React Native Hybrid Apps
TikTok Frontend Technology Team
TikTok Frontend Technology Team
Feb 23, 2022 · Frontend Development

Understanding Virtual DOM and Diff Algorithms in Frontend Frameworks

This article explains the concept of virtual DOM, its advantages over direct DOM manipulation, details the diff algorithm including same‑layer comparison, pointer techniques, and longest increasing subsequence optimizations in Vue2 and Vue3, and discusses key usage and performance considerations.

Diff AlgorithmVirtual DOMVue
0 likes · 23 min read
Understanding Virtual DOM and Diff Algorithms in Frontend Frameworks
Sohu Tech Products
Sohu Tech Products
Dec 15, 2021 · Frontend Development

Implementing a Simple Virtual DOM Library with Patch and Diff Algorithms

This article explains how to build a lightweight virtual DOM library in JavaScript, covering the creation of VNode objects, the patch and diff algorithms, handling of attributes, classes, styles, and events, and demonstrates a step‑by‑step implementation using the Snabbdom approach.

Diff AlgorithmJavaScriptPatch
0 likes · 18 min read
Implementing a Simple Virtual DOM Library with Patch and Diff Algorithms
Beike Product & Technology
Beike Product & Technology
Nov 5, 2021 · Frontend Development

Understanding React Fiber Architecture and Diff Algorithm in React 16

This article explains the React Fiber architecture introduced in React 16, compares it with React 15, details how Fiber nodes form a tree, and walks through the source-level implementation of the Diff algorithm, including single-node and multi-node updates, with code examples and diagrams.

Diff AlgorithmFiberReact
0 likes · 17 min read
Understanding React Fiber Architecture and Diff Algorithm in React 16
政采云技术
政采云技术
Nov 2, 2021 · Frontend Development

Why Using Index as Key in Vue Is Discouraged

Using an array index as the key in Vue list rendering can cause unnecessary DOM re‑creation, performance degradation, and data misalignment, especially when items are inserted, removed, or reordered, so developers should prefer stable, unique identifiers such as IDs, symbols, or UUIDs for keys.

Diff AlgorithmVuefrontend
0 likes · 17 min read
Why Using Index as Key in Vue Is Discouraged
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 23, 2021 · Frontend Development

Understanding Virtual DOM and Diff Algorithm in Vue.js (Vue2 and Vue3)

This article explains the concept of virtual DOM, its structure, and how Vue's diff (patch) algorithm works, including detailed code walkthroughs, optimization strategies, key usage, and differences between Vue2 and Vue3 implementations, helping readers fully grasp the underlying principles and performance improvements.

Diff AlgorithmOptimizationPatch
0 likes · 28 min read
Understanding Virtual DOM and Diff Algorithm in Vue.js (Vue2 and Vue3)
Tencent Cloud Developer
Tencent Cloud Developer
Sep 15, 2021 · Frontend Development

Deep Dive into Vue.js Virtual DOM Diff Algorithm and Source Code Analysis

The article thoroughly explains Vue.js’s virtual‑DOM diff algorithm, detailing its depth‑first traversal, same‑level node comparison, the sameVnode key/selector check, index map creation, O(n) head‑tail and index‑based matching loops, Vue 3 static‑type optimizations, and a practical implementation for array change detection.

Diff AlgorithmVirtual DOMVue.js
0 likes · 6 min read
Deep Dive into Vue.js Virtual DOM Diff Algorithm and Source Code Analysis
Sohu Tech Products
Sohu Tech Products
May 12, 2021 · Mobile Development

Understanding Diff Algorithms and Batch Updates in UICollectionView (iOS)

This article explains the concept of diff algorithms, demonstrates how to perform partial updates in iOS UICollectionView using insert, delete, reload and move APIs, introduces edit paths and the Wagner–Fischer dynamic‑programming algorithm, and provides Swift code examples for calculating optimal edit steps.

Batch UpdatesDiff AlgorithmSwift
0 likes · 12 min read
Understanding Diff Algorithms and Batch Updates in UICollectionView (iOS)
Youzan Coder
Youzan Coder
Oct 12, 2018 · Frontend Development

Understanding Virtual DOM: Concepts, Implementation, and Mapping to Real DOM

The article explains the Virtual DOM as a lightweight JavaScript object with tag, props, and children, shows how JSX compiles to VD using a custom pragma, provides helper functions to create real DOM from VD, and outlines how batching updates reduces reflows, previewing a future diff algorithm.

Diff AlgorithmFront-endJSX
0 likes · 7 min read
Understanding Virtual DOM: Concepts, Implementation, and Mapping to Real DOM