From: Evan You Date: Sun, 28 Oct 2018 19:58:59 +0000 (-0400) Subject: perf: skip props update if data object is the same X-Git-Tag: v3.0.0-alpha.0~1068 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d8cda2387f716fb7eb90dd50b65e6acac11484ff;p=thirdparty%2Fvuejs%2Fcore.git perf: skip props update if data object is the same --- diff --git a/packages/runtime-core/src/createRenderer.ts b/packages/runtime-core/src/createRenderer.ts index 354450d959..e16424f656 100644 --- a/packages/runtime-core/src/createRenderer.ts +++ b/packages/runtime-core/src/createRenderer.ts @@ -468,7 +468,7 @@ export function createRenderer(options: RendererOptions) { } function patchStatefulComponent(prevVNode: MountedVNode, nextVNode: VNode) { - const { childFlags: prevChildFlags } = prevVNode + const { data: prevData, childFlags: prevChildFlags } = prevVNode const { data: nextData, slots: nextSlots, @@ -481,7 +481,9 @@ export function createRenderer(options: RendererOptions) { instance.$parentVNode = nextVNode as MountedVNode // Update props. This will trigger child update if necessary. - updateProps(instance, nextData) + if (nextData !== prevData) { + updateProps(instance, nextData) + } // If has different slots content, or has non-compiled slots, // the child needs to be force updated. It's ok to call $forceUpdate