Glossary coding Term Page

DocumentFragment

Temporary DOM bucket for staging nodes without triggering layout.

document-fragment #performance#dom
Korean version

Aliases

doc fragment

Prerequisites

Related Concepts

Core Idea

A DocumentFragment lives in memory, so appending nodes to it skips layout and paint work until you insert the fragment into the real DOM. That batching makes it ideal for rendering long lists or assembling templates before exposing them to the page.

Why It Matters Here

Mathbong’s performance lessons rely on fragments to illustrate how a single append beats dozens of tiny writes. They bridge partial updates and anti-patterns like layout thrashing, keeping UI helpers predictable even when data sets grow.

Posts Mentioning This Concept