You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(useComponentProps): treats Vue's internal __v_* flag reads as prop lookups (regex + theme lookups on every probe) #7185
This is a performance issue that only shows up in a CPU profile, so there is no playground link. It does not change any visible behaviour. The snippet below shows it directly: reading an internal Vue flag on the props proxy runs the regex case conversions.
import{defineComponent,h,isReadonly}from'vue'import{mount}from'@vue/test-utils'import{useComponentProps}from'@nuxt/ui/runtime/composables/useComponentProps'mount(defineComponent({props: {color: String},setup(raw){constprops=useComponentProps('button',raw)constreplace=vi.spyOn(String.prototype,'replace')isReadonly(props)// Vue reads props.__v_isReadonlyconsole.log(replace.mock.calls.length)// > 0: camelCase/kebabCase ran for "__v_isReadonly"return()=>h('i')}}))
To see the cost in a real app: run node --cpu-prof .output/server/index.mjs, request a page withlook at camelCase/kebabCase/propIsDefined together with isReadonly, isRef, toRaw andreactivePick inside the useComponentPropsget trap.
Description
useComponentProps returns a Proxy whose get trap returns early only for __v_isReactive and __v_raw. Vue and VueUse also read other internal flags on that proxy all the time: __v_isReadonly, __v_isShallow, __v_isRef and __v_skip. isReadonly, isRef, unref, toRaw, reactive(), reactivePick and toReactive all do this, and useForwardProps(pickLinkProps(props)) in UButton/ULink triggers it for every forwarded prop.
Each of those reads goes through the whole prop-resolution path:
Reflect.get on the props
theme lookup in defaults.value
propIsDefined(), which runs two String.replace regexes (camelCase + kebabCase)
appConfig.ui[name].defaultVariants lookup
vm.type.props[prop] lookup
and then always returns undefined, because no component declares a __v_* prop.
On our production SSR build, one UButton used as a link costs about 1 ms of server CPU per render. A route list with ~50 buttons spends a noticeable share of each request in this trap.
Additional context
`__v_isReactive` and `__v_raw` are already handled, so other `__v_*` keys reaching the prop path looks like an oversight rather than intent. The return value stays `undefined` either way, so the early return doesn't change behaviour: `isReadonly()`/`isShallow()` give the same results as now.
### Logs```shell-script
changed the title [-]perf: `useComponentProps` treats Vue's internal `__v_*` flag reads as prop lookups (regex + theme lookups on every probe)[/-][+]perf(useComponentProps): treats Vue's internal `__v_*` flag reads as prop lookups (regex + theme lookups on every probe)[/+]on Oct 12, 2026
Activity
[-]perf: `useComponentProps` treats Vue's internal `__v_*` flag reads as prop lookups (regex + theme lookups on every probe)[/-][+]perf(useComponentProps): treats Vue's internal `__v_*` flag reads as prop lookups (regex + theme lookups on every probe)[/+]