From e87d9a1b73183cc8613fe604598fa70823fd49a5 Mon Sep 17 00:00:00 2001 From: kazuya kawaguchi Date: Sun, 17 Sep 2017 04:41:29 +0900 Subject: [PATCH] perf(core): Improve DevTools perfromance user timing measurement name --- src/core/instance/init.js | 4 ++-- src/core/instance/lifecycle.js | 4 ++-- src/platforms/web/entry-runtime-with-compiler.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/instance/init.js b/src/core/instance/init.js index ddf808e4116..f4b4db5742a 100644 --- a/src/core/instance/init.js +++ b/src/core/instance/init.js @@ -21,7 +21,7 @@ export function initMixin (Vue: Class) { let startTag, endTag /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && config.performance && mark) { - startTag = `vue-perf-init:${vm._uid}` + startTag = `vue-perf-start:${vm._uid}` endTag = `vue-perf-end:${vm._uid}` mark(startTag) } @@ -62,7 +62,7 @@ export function initMixin (Vue: Class) { if (process.env.NODE_ENV !== 'production' && config.performance && mark) { vm._name = formatComponentName(vm, false) mark(endTag) - measure(`${vm._name} init`, startTag, endTag) + measure(`vue ${vm._name} init`, startTag, endTag) } if (vm.$options.el) { diff --git a/src/core/instance/lifecycle.js b/src/core/instance/lifecycle.js index 768e2e2b54a..fd01d510865 100644 --- a/src/core/instance/lifecycle.js +++ b/src/core/instance/lifecycle.js @@ -176,12 +176,12 @@ export function mountComponent ( mark(startTag) const vnode = vm._render() mark(endTag) - measure(`${name} render`, startTag, endTag) + measure(`vue ${name} render`, startTag, endTag) mark(startTag) vm._update(vnode, hydrating) mark(endTag) - measure(`${name} patch`, startTag, endTag) + measure(`vue ${name} patch`, startTag, endTag) } } else { updateComponent = () => { diff --git a/src/platforms/web/entry-runtime-with-compiler.js b/src/platforms/web/entry-runtime-with-compiler.js index 45aa80211d0..5ca67b6e8e2 100644 --- a/src/platforms/web/entry-runtime-with-compiler.js +++ b/src/platforms/web/entry-runtime-with-compiler.js @@ -73,7 +73,7 @@ Vue.prototype.$mount = function ( /* istanbul ignore if */ if (process.env.NODE_ENV !== 'production' && config.performance && mark) { mark('compile end') - measure(`${this._name} compile`, 'compile', 'compile end') + measure(`vue ${this._name} compile`, 'compile', 'compile end') } } }