Sfoglia il codice sorgente

refactor: Improve DevTools perfromance user timing measurement name (#6624)

kazuya kawaguchi 8 anni fa
parent
commit
894d380e40

+ 2 - 2
src/core/instance/init.js

@@ -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)
     }
@@ -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) {

+ 2 - 2
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 = () => {

+ 1 - 1
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')
       }
     }
   }