Skip to content

Commit

Permalink
fix perf measure regression for nested components of the same name (fix
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 13, 2017
1 parent d185dd2 commit 45e273f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/core/instance/init.js
Expand Up @@ -16,7 +16,7 @@ export function initMixin (Vue: Class<Component>) {
Vue.prototype._init = function (options?: Object) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
mark('init')
mark('vue-perf-init')
}

const vm: Component = this
Expand Down Expand Up @@ -57,8 +57,8 @@ export function initMixin (Vue: Class<Component>) {
/* istanbul ignore if */
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
vm._name = formatComponentName(vm, false)
mark('init end')
measure(`${vm._name} init`, 'init', 'init end')
mark('vue-perf-init-end')
measure(`${vm._name} init`, 'vue-perf-init', 'vue-perf-init-end')
}

if (vm.$options.el) {
Expand Down
5 changes: 3 additions & 2 deletions src/core/instance/lifecycle.js
Expand Up @@ -164,8 +164,9 @@ export function mountComponent (
if (process.env.NODE_ENV !== 'production' && config.performance && mark) {
updateComponent = () => {
const name = vm._name
const startTag = `start ${name}`
const endTag = `end ${name}`
const id = vm._uid
const startTag = `vue-perf-start:${id}`
const endTag = `vue-perf-end:${id}`

mark(startTag)
const vnode = vm._render()
Expand Down

0 comments on commit 45e273f

Please sign in to comment.