360 Secure SkillHub
360 安全技能中心

vue-performance

面向 Vue 3 应用的性能排查与优化 Skill,指导用 Vue DevTools 和浏览器面板测量,按症状分析包体积、渲染卡顿与内存泄漏,并给出 shallowRef、虚拟列表、代码分割和 Vapor Mode 等修复建议。

分类:开发
KIMJINWOO4
热度 0.00
最近更新 2026-11-19 17:33:54

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add kimjinwoo4/vue-skills/vue-performance
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
vue-performance
description
Diagnose and fix Vue 3 performance problems. Profiling with Vue DevTools and the browser, render tracking, shallowRef, v-memo, list virtualization, Vapor Mode, bundle size with code splitting and Rolldown analysis, and memory leaks. Use when a Vue app is slow, janky, too large or leaking memory, or when reviewing code for performance.

Vue Performance

Versions checked on 2026-10-15: Vue 3.5 (3.6 RC with Vapor Mode), Vite 8.3 with Rolldown.

Measure before changing anything. Read diagnose first, then go to the reference that matches the symptom.

Triage

Symptom Area Reference
Slow first load, large JavaScript download Bundle bundle
Slow interactions, typing lag, janky lists Rendering rendering
Tab gets slower over time or crashes after long use Memory memory-leaks
"It feels slow", no numbers yet Measurement diagnose

Quick wins to check first

  1. shallowRef for large objects and arrays that are replaced rather than mutated, such as API responses.
  2. Stable :key values in v-for, and computed for filtered lists instead of method calls in the template.
  3. Virtualize lists longer than about 200 rows (useVirtualList, vue-virtual-scroller).
  4. Split code by route; file-based routing does it for free.
  5. Load heavy below-the-fold widgets with defineAsyncComponent, and use lazy hydration in Nuxt.
  6. Keep props stable in hot lists: no new objects, arrays or closures created inline per render.
  7. Watch a getter on the field you need instead of deep: true on a large tree.
  8. On Vue 3.6, move components the profiler flags as hot to Vapor Mode (vue-36-vapor).

Tools

  • Vue DevTools: component render timings, timeline, Pinia state.
  • Browser Performance panel for long tasks and layout work; Memory panel heap snapshots for leaks.
  • Vite DevTools (experimental in Vite 8.3, devtools: true with @vitejs/devtools) for module graph and Rolldown bundle analysis.

Do not

  • Add v-memo everywhere. It is for a proven hot v-for and has its own comparison cost.
  • Switch working code to markRaw or shallowReactive on a guess; both remove guarantees other code relies on.
  • Call something an optimization without a before and after number.