Skip to content

Commit

Permalink
refactor: Improve DevTools perfromance user timing measurement name (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon authored and yyx990803 committed Oct 2, 2017
1 parent 0f2cb09 commit 894d380
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/instance/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function initMixin (Vue: Class<Component>) {
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)
}
Expand Down Expand Up @@ -62,7 +62,7 @@ export function initMixin (Vue: Class<Component>) {
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) {
Expand Down
4 changes: 2 additions & 2 deletions src/core/instance/lifecycle.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/platforms/web/entry-runtime-with-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
}
}
Expand Down

0 comments on commit 894d380

Please sign in to comment.