Frontend Development 10 min read

Key Performance and API Improvements in Vue 3

Vue 3 introduces substantial performance gains, a smaller bundle size, tree‑shakable global APIs, a proxy‑based reactivity system, and experimental time‑slicing features, all of which make modern, mobile‑first web development faster and more efficient.

Sohu Tech Products
Sohu Tech Products
Sohu Tech Products
Key Performance and API Improvements in Vue 3

Vue 3 brings a major upgrade over Vue 2, focusing on speed, smaller bundle size, easier maintenance, native‑targeted features, and a smoother developer experience.

Performance Optimization

The minified and compressed runtime of Vue 3 is about 20 kB, roughly half the size of Vue 2.6.10 (≈22.8 kB), promising faster load times.

Global API Tree‑shaking

Vue 3’s source code now supports tree‑shaking, meaning unused features such as keep-alive or the v-show directive are omitted from the final bundle. In Vue 2 the entire Vue object was exported, preventing bundlers from eliminating dead code.

// Vue 2.x – whole `Vue` object is bundled for production
import Vue from 'vue'

Vue.nextTick(() => {})
const obj = Vue.observable({})

Vue 3 switches to named exports so that only the APIs you import are included:

// Vue 3.x – only imported properties are bundled
import { nextTick, observable } from 'vue'

nextTick(() => {})
const obj = observable({})

This change affects APIs such as Vue.nextTick , Vue.observable , Vue.version , Vue.compile (full build only), Vue.set , and Vue.delete . Compatibility builds will still support legacy plugins, albeit with a performance cost.

The compiler also tree‑shakes directives. For example, the template:

<transition>
  <div v-show="ok">hello</div>
</transition>

is compiled to something like:

import { h, Transition, applyDirectives, vShow } from 'vue'

export function render() {
  return h(Transition, [
    applyDirectives(h('div', 'hello'), this, [vShow, this.ok])
  ])
}

Proxy‑Based Reactivity

Vue 3 replaces the Object.defineProperty‑based reactivity system with a JavaScript Proxy, eliminating the need for Vue.set and Vue.delete to track property addition or deletion. Adding a new property now looks like:

// Vue 2.x
Vue.set(this.myObject, key, value)
// Vue 3
this.myObject[key] = value

Tests show initialization and patching are roughly twice as fast, though Vue 3 drops official support for Internet Explorer (Edge is still supported).

Time‑Slicing (Experimental)

Future versions after Vue 3 may experiment with time‑slicing, breaking long‑running script tasks into small chunks and yielding to the main thread to keep the UI responsive. This mirrors how browsers interleave user input handling with script execution.

New Lifecycle Hook – renderTriggered

Vue 3 introduces a renderTriggered hook that logs unnecessary component re‑renders, which can be combined with time‑slicing for powerful runtime performance tuning:

const Component = {
  // other properties
  renderTriggered(event) {
    console.log(`Re-render of ` + this.$options.name + ` component`, event)
  }
}

Additional improvements include better code generation for JavaScript engine optimizations, more efficient patch algorithms that avoid unnecessary parent/child re‑renders, and overall smaller, faster output code.

Overall, Vue 3’s enhancements make it an excellent choice for modern, performance‑oriented, mobile‑first web development while retaining the flexibility that has made Vue a community‑driven mainstream framework.

frontendperformancejavascriptproxyVuetree shakingVue3
Sohu Tech Products
Written by

Sohu Tech Products

A knowledge-sharing platform for Sohu's technology products. As a leading Chinese internet brand with media, video, search, and gaming services and over 700 million users, Sohu continuously drives tech innovation and practice. We’ll share practical insights and tech news here.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.