• performance.memory

    JsHeapSizeLimit JS Memory usage limit totalJSHeapSize JS total memory usedJSHeapSize JS used memoryCopy the code

Note: usedJSHeapSize represents all js stack memory used; TotalJSHeapSize indicates the total memory size of the current JS stack. This means that usedJSHeapSize cannot be greater than totalJSHeapSize. If it is greater than totalJSHeapSize, a memory leak may occur.

  • performance.navigation

    • performance.navigation.type

      An unsigned short integer representing how to navigate to the page provides information about what happened at the specified time, including whether the page was loaded or refreshed, how many redirects occurred, and so on.Copy the code

      TYPE_NAVIGATE (0)

      The current page is done by clicking on links, bookmarking, and form submission, or by scripting, or by entering the address directly in the URL with type 0Copy the code

      TYPE_RELOAD (1)

      Click the refresh page button or the page displayed via the location.reload () method with a type value of 1Copy the code

      TYPE_BACK_FORWARD (2)

      Pages are accessed through history and backwards and forwards. Type a value of 2Copy the code

      TYPE_RESERVED (255)

      Any other way, the type value is 255Copy the code
    • performance.redirectCount

      Redirection timesCopy the code

  • performance.timing

    Object contains delay-related performance information.Copy the code
    attribute meaning
    navigationStart Start time when the new page is ready to load
    unloadEventStart If the previous web page belongs to the same domain name as the current web page, the Unix millisecond timestamp is returned when the unload event for the previous web page occurred. If there is no previous web page or the previous web page is not in the same domain name, the return value is 0.
    unloadEventEnd If the previous page belongs to the same domain as the current page, the Unix millisecond timestamp is returned at the end of the callback function for the previous Page’s Unload event. If there is no previous web page or the previous web page is not in the same domain name, the return value is 0.
    redirectStart FetchStart (timing. FetchStart) ¶ If an HTTP redirect occurs and each intermediate redirect is in the same domain as the current document, the timing. FetchStart value is returned. Otherwise, 0 is returned Redirection start
    redirectEnd If an HTTP redirect occurs and each intermediate redirect is codomain with the current document starting with the navigation, the time after the last redirect was received is returned. Otherwise, 0 is returned Redirection end
    fetchStart If a new resource acquisition is initiated, fetchStart must return the time at which the user agent started checking its associated cache, otherwise it must return the time at which the resource acquisition began
    domainLookupStart Returns the time when the user agent starts a DNS query for the domain to which the current document belongs. If this request has no DNS query process, such as long connections, resource cache, or even local resources, etc. So return the value of fetchStart
    domainLookupEnd Returns the time when the user agent ends the DNS query for the domain to which the current document belongs. If this request has no DNS query process, such as long connections, resource cache, or even local resources, etc. So return the value of fetchStart
    connectStart Returns the time when the user agent requests a document from the server server to begin establishing a connection, if the connection is a long one, or if the resource is fetched directly from the cache (that is, there is no connection to the server). The value of domainLookupEnd is returned
    (secureConnectionStart) Optional feature. If the user agent does not have a corresponding object, set this to undefined. If you have this, and it’s HTTPS, you return to the time when the SSL handshake started. If it is not HTTPS, then 0 is returned
    connectEnd Returns the time after the user agent requests a document from the server server and establishes a connection, if the connection is a long one, or if the resource is fetched directly from the cache (that is, no connection is made to the server). The value of domainLookupEnd is returned
    requestStart Returns the time when the document was requested from the server, cache, local resource, and so on
    responseStart Returns the time when the user agent received the first byte of data from the server, cache, or local resource
    responseEnd Returns the earlier of the last character received by the user agent and the time when the current connection was closed. Again, documents may come from a server, cache, or local resource
    domLoading Return to the time when the user agent set “Current document Readiness” to “loading” for its document
    domInteractive Returns to the time when the user agent set “Current Document Readiness” to “interactive” for its document.
    domContentLoadedEventStart Returns the time when the DOMContentLoaded event occurred for the document
    domContentLoadedEventEnd The end time of the DOMContentLoaded event for the document
    domComplete Returns to the time when the user agent set “Current Document Readiness” to “complete” for its document
    loadEventStart The time when the document triggers the load event. If the load event is not fired, the interface returns 0
    loadEventEnd The time after the document triggers the load event. If the load event is not fired, the interface returns 0

    DNS time = domainLookupEnd – domainLookupStart TCP time = connectEnd – connectStart Back-end time = responseEnd – connectEnd

    The back-end time calculated may be negative. The IOS device enters the page through the forward and back buttons of the browser, and the connectStart and responseEnd data in the Navigation Timing API may be 0 or a relatively small value, which is not the timestamp of the corresponding time point. When IOS devices read pages from the cache, the calculation of Navigation Timing is inconsistent with android implementation.Copy the code

    White screen time = domInteractive – navigationStart Whole screen time = loadEventEnd – navigationStart First screen time = (DOM parsing complete && all first screen images loaded complete) – navigationStart

    Dom Tree Parsing Time = domComplete-dominteractive Request Time = responseEnd – responseStart

  • performance.now()

    Performance. A now method returns since the performance for the current page. Timing. NavigationStart between the current time on the number of milliseconds (ms) one over one thousand. That means it can be accurate to a millionth of a second.Copy the code
    <! By calling the performance. Now method twice, you can get the exact time of the interval as a measure of how long an operation is taking. --> var start = performance.now();doTasks();
        var end = performance.now();
        console.log('Time:' + (end - start) + 'microseconds. ');
    Copy the code
  • performance.mark()

    The MARK method is used to mark the corresponding viewpoint. Performance. Mark () is also used to calculate program execution time accuratelyCopy the code
        function () {
            if (this.cstmIdList.length == 0) {
              this.customerGet()
            }
            this.linker = JSON.parse(JSON.stringify(row))
            
            window.performance.mark(this.linker)
            
            this.linker.originCstmId = this.linker.cstmId
            if(this.$refs['linker'] !== undefined){
              this.$refs['linker'].clearValidate()
            }
            this.disabled = true
            if(row.mainStatus == 1){
              this.disabledMainStatus = true
            }
            this.dialogTitle = 'Edit contact information'
            this.btnStr = 'update'
            this.dialogShow = true
            
            window.performance.mark(this.dialogShow)
            let mark = window.performance.getEntriesByType('mark') the console. The log (mark) / / measuring window. Performance. The measure (enclosing dialogShow) var measure = window. Performance. GetEntriesByType ('measure')
            console.log(measure)
        }
    Copy the code

The end time is 6006.250000000001

The start time is 6006.205000000001

The execution time is 6006.250000000001-6006.205000000001 = 0.045

` ` ` window. / / clear specified tag performance. ClearMarks (" mark "); / / to remove all the tags window. Performance. ClearMarks (); / / remove specified measuring window. Performance. ClearMeasures (' measure '); / / remove all measurement window. Performance. ClearMeasures (); ` ` `Copy the code