In fact, to determine whether the execution speed of a page is slow or not, the following time is the key:
Page Server execution time
That is, whether the server executes the processing speed of the main page. Generally, we need to eliminate the network impact (LAN), pass the stress test orProgramInternal tracking to get this time. For example, I wrote system on the server page page_load. thread. sleep (1000), blocking the current execution thread for 1 second (you can understand it as our actual processing logicCodeFor example, to open the database query, etc.), the execution time on the server is 1 second + the construction time of the ASP. NET webform framework model, usually 1 ~ About 1.01.
Page Server Response Time
And the response time of the server that contains the network, usually the time when the request connection is established to the end of the response connection. Aside from the network impact, the time should be consistent with the execution time of the Page Server, if the difference is large, it indicates that the data transmitted on the page is too large and needs to be optimized.
DomcontentonloadTime
In general, there are many display elements on the page. On a page with better user experience, it is likely to perform context processing on the DOM elements, this time is the time when the Dom is built. GenerallyTime indicates the time when the client interprets the page.If it is too long, it is obvious that the page structure is unreasonable.
Document. onloadTime
Onload is the time when all resources on the page must be obtained (not including images or some peripheral resources). If it is too long, it is obvious that domcontentonload is too long or the resource request time must be too long (a lot of CSS, dynamically generated JS is too large, etc.). Generally, document. onload can be considered as the time when the customer starts to see the relatively complete web page. This time is directly related to the user experience.
Page rendering time
After the page is fully opened, the browser parses the page and the time when the customer sees all the content of the complete page. For example, I used js to create 10 thousand buttons on the page, the time displayed for all these buttons is the page rendering time. This time is closely related to the memory of the client CPU and video card, which is directly influenced by the client logic of the page. It is difficult to track and judge. Therefore, this time is generally used to test the browser's execution speed.