perf(reactivity): skip type checks for cached proxies#14860
Conversation
📝 WalkthroughWalkthroughThis PR refactors proxy-type detection in createReactiveObject (replace getTargetType with targetTypeMap) and adds benchmarks for cached reactive reuse and nested reactive property access. ChangesReactive Object Proxy Refactoring
Sequence Diagram(s)sequenceDiagram
participant BenchRunner
participant reactive
participant createReactiveObject
participant proxyMap
participant targetTypeMap
BenchRunner->>reactive: call reactive(raw)
reactive->>createReactiveObject: forward target
createReactiveObject->>proxyMap: lookup existing proxy
createReactiveObject->>targetTypeMap: compute target type if needed
createReactiveObject-->>reactive: return proxy (cached or new)
BenchRunner->>reactive: call reactive(raw) again (cached path)
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/reactivity/__benchmarks__/reactiveObject.bench.ts`:
- Around line 25-27: The benchmark labeled "read nested reactive obj property"
is only accessing r.a but should exercise a nested access; update the bench body
(the callback passed to bench) to read the nested property (e.g., r.a.b) instead
of just r.a so the benchmark measures the nested path—modify the callback that
currently references r.a to access r.a.b (or the appropriate nested key on r) in
the bench invocation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7096b990-7671-4011-96a7-511e8cd94516
📒 Files selected for processing (2)
packages/reactivity/__benchmarks__/reactiveObject.bench.tspackages/reactivity/src/reactive.ts
6d17709 to
bc25d3d
Compare
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI: Open
|
Summary
Test Plan
Representative local benchmark run after the latest change: