Turn: Building a high-performance ASP. NET Site Chapter 5-Performance Tuning Overview (Part II)

Source: Internet
Author: User
This article mainly describes how to locate the performance problems of the Site Based on some simple tools and Simple phenomena.

The topics in this chapter are as follows:

General performance tuning process

Analyze page loading information using analysis tools

Analyze performance bottlenecks using analysis tools

Analyze performance bottlenecks using analysis tools

In the previous section, we talked about how to use Firebug to generate a waterfall chart for page loading information and four major problems that make page loading slow:

1. The server spends a lot of time parsing. aspx time is too long.

2. It takes too long to pass html between the server and the browser.

3. the loading time of images and flash files is too long.

4. Loading Js and css takes a long time

Next we will judge based on the waterfall chart: the reason for slow page loading is what causes it.

 

1.How to judge: The server spends a lot of time parsing. aspxToo long.

In the figure below, you can see that the first timeline is particularly long:PurpleThat indicates the waiting time before the browser receives the first byte of the page. That is to say, after the browser requests the Default. aspx page, the browser remains in the waiting state. Only after the browser accepts the DOM of Default. aspx can it download other resources (such as css and images) on the page ). If the wait time is too long before accepting the DOM of Default. aspx, the download of other resources will inevitably be affected, and the loading of the entire page will be slowed down.

 

 

 

If the above similar phenomenon is found when we use firebug to generate a waterfall chart, the cause of slow page loading is probably that the server is parsing Default. on the aspx page, it takes too long to generate html text. As to what causes the server to parse Default. aspx for a long time, further analysis is required. It may be that the Code is not well written, such as a loop problem; it may be a database problem, for example, the query data is too slow or there is too much data (detailed in subsequent articles ). 

 

Note: color means:

 

 

 

2.How to determine: Transfer html between the server and the browserToo long

In the figure below, we can see that the purple line segment is relatively short, that is, the time for the server to parse the Default. aspx page is relatively short,Gray,. The gray part indicates that it takes a long time to accept the data. That is to say, the server sends the DOM to the browser, which takes a long time. As with the previous issue, this issue will also delay the download of other resources on the page, resulting in slow loading of the entire page. This problem may be caused by bandwidth problems, or excessive data.

 

 

 

3.How to judge: Images and flashThe file loading time is too long.

As shown in, page parsing and transfer to the client are relatively short, but it takes a lot of time to load images on the page. Currently, browsers usually open multiple links at the same time to request multiple image resources in parallel, rather than one request by one. However, there are limits on the number of opened links in the browser (different browsers), and it takes time to open the new TCP link, not the more links, the better. The following describes how to reduce the loading time of images and other resources.

 

 

 

4. How to judge: loading Js and css takes too long to prevent page rendering

As shown in, after loading the Default. aspx page, the browser begins to parse the DOM (from top to bottom, for example, head-> body ...), Download resources. When the page is parsed to the need to load css and js, the browser will go to the server to request these files, and the Default page that the user sees in the browser will be blank, after loading css and js, the page starts to download images, and the page will be displayed slowly.

The problem was resolved.

 

Today, we are here. From the next article, we have entered the analysis and optimization stage.

 

From: http://www.cnblogs.com/yanyangtian/archive/2011/02/11/1951055.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.