October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Virtual DOM or Direct DOM Updates: Which Is Faster, and When?

Virtual DOM adds calculation and comparison work, but can reduce unnecessary DOM mutations. Which approach is faster depends on the workload and implementation.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Neither is universally faster. A virtual DOM is an in-memory description that a framework uses to calculate changes; the browser still updates and displays the real DOM. Building and comparing that description has a cost, but it can help avoid unnecessary DOM operations. A narrowly targeted direct update may skip that work. The better choice depends on the update pattern, implementation, and browser workload.

What “virtual DOM vs real DOM” actually compares

The real DOM is the browser’s representation of a page. A virtual DOM (VDOM) is an in-memory representation used by some UI frameworks; it is not a replacement for the browser DOM. Vue describes the VDOM as an idealized UI representation kept in memory and synchronized with the real DOM. In Vue’s pipeline, templates are compiled into render functions, the renderer creates browser nodes, and a state change produces a new virtual tree that is compared with the previous one and patched into the real DOM. Vue’s compiler can mark static areas and dynamic descendants so runtime work can skip or narrow parts of that process. Vue: Rendering Mechanism

As an Amazon Associate I earn from qualifying purchases.

React likewise distinguishes rendering—calculating what the UI should look like—from committing necessary changes to the DOM. The browser paints after DOM updates are committed. So the meaningful comparison is between complete update strategies: calculating and reconciling a UI description before changing the DOM, versus applying known DOM changes directly. It is not a contest between a virtual page and a page that does not use the DOM. React: Render and Commit

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the answer changes with the workload

A small, known change

If an application already knows exactly which element and property changed, a direct update can avoid the work of producing and comparing a broader UI description. That can be advantageous for a tightly scoped operation. But it is not a universal shortcut: application code still has to identify the right update and keep the interface consistent as state and interactions grow.

A larger or less localized update

When many parts of the interface may have changed, calculating the next UI and comparing it with the previous one can help a framework limit DOM mutations to what is needed. That calculation is not free, and its cost varies with the framework, compiler optimizations, and application code. A framework’s ability to skip static regions or focus on dynamic content can materially affect the result.

What one published benchmark illustrates

Mattias Levlin’s 2020 thesis, DOM benchmark comparison of the front-end JavaScript frameworks React, Angular, Vue, and Svelte, tested React 16.12.0, Vue 2.6.11, Angular 8.2.14, and Svelte 3.20.0. Its results varied sharply by operation:

Test in Levlin’s 2020 thesis Reported averages
Single-element edit Svelte: 0.11 ms; React: 16.58 ms; Vue: 22.23 ms
Editing text in 10,000 existing elements React: 17.86 ms; Vue: 20.64 ms; Svelte: 885.03 ms; Angular: 896.76 ms

These are measurements from that thesis’s particular implementations and environment, not a current framework ranking or a general measure of virtual DOM performance. The single-element result and the 10,000-element result point in different directions; the useful lesson is that operation size and implementation matter. Levlin thesis (2020)

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A 2024 article’s accessible abstract also describes a React-versus-vanilla-JavaScript comparison and says outcomes depend on application complexity and interaction frequency. Its article page does not provide detailed benchmark tables in the available material, so it does not support precise numerical comparisons. Muppaneni article page (2024)

How to compare performance for your own app

Test the same user interaction and visible result in each implementation. Record the conditions and compare the whole update path rather than timing only one convenient step.

  1. Define the interaction. Is it one known element changing, a batch of changes, or an update that touches much of a screen?
  2. Include repeated UI work. Measure the work needed to produce the next state as well as the resulting DOM updates.
  3. Use the optimizations the app would ship with. Account for compiler or framework handling of static content and dynamic regions.
  4. Control the test conditions. Record the framework version, production or development build, browser, hardware, and measurement method.
  5. Measure the interface that matters. Consider mounted DOM-node count and the time for the user-visible interaction, not just an isolated update function.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

When large lists are the bottleneck

A page can spend substantial time handling a large number of mounted DOM nodes, regardless of the label attached to its rendering approach. Vue recommends list virtualization for large lists; React’s legacy performance guide describes windowing as a way to reduce re-rendering time and the number of DOM nodes. These techniques keep only the relevant portion of a long list mounted. They are practical ways to address list costs, not proof that either virtual-DOM or direct-DOM rendering is inherently faster. Vue: Performance React: Optimizing Performance

Which approach should you choose?

  • Choose a framework strategy for the overall application when maintainable state-driven UI and coordinated updates matter; do not select it on the assumption that a VDOM is automatically faster.
  • Consider direct DOM updates when a change is narrowly known and the application can manage it consistently.
  • For either approach, profile the real bottleneck. Repeated component work, rendering, DOM-node count, and browser painting can all affect perceived speed.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.