Asp.net program performance optimization Summary

Source: Internet
Author: User

Asp.net program performance optimization Summary

-- For more information, see

1. cache: page OutPut buffer (based on the parameter VaryByParams, Location, saved to the hard disk), User Control fragment cache (VaryByControl = "Con ": create separate cache entries for each page of the control), cache API, data buffer (File dependency, time dependency, relative expiration dependency), callback cache (<asp: substitution/> ).

2. Data Processing Optimization:

A) return a large amount of data without processing it. Use SqlDataReader for the return type. Do not use DataSet for read-only data access.

B) advantages of using stored procedures: 1. It helps with complex businesses. 2. scalability, database structure change, and easy maintenance and modification. 3. Reduce the network transmission time. 4. Pre-compilation is much faster than executing SQL statements.

C) query statement optimization: set forceplan forces SQL Server to use tables in the order they appear. Use it to select the table join sequence.

D. Close the database immediately after connection is used. Which of the following is better than manually disabling the database automatically with using? (To be queried)

E) Optimize the query statement. Not including subquery statements in the query statement, make full use of the index.

F) pagination of data. The data required for each request is returned by page number and number of entries per page. [F and g see 9]

G) returns multiple datasets. Use the ExecuteReader method of the SqlCommand object to return a strong business object, and then call the NextResult method to move the dataset pointer to locate the dataset. However, you must write the business logic into the stored procedure.

3. Page optimization:

A) EnableViewState = false. For example, the page does not need to be returned or is only displayed at a time.

B) page layout: FlowLayout is better than GridLayout (absolute positioning, more code.

C) Try to use html controls and use javascript. Select Repeater> Datalist> DataGrid as the data control.

4. String operation: "s" + 2. ToString (); Use StringBuilder.

5. Use the Server. Transfer syntax to avoid unnecessary client redirection.

6. Enable network gardening.

7. Optimize the web Server:

A) only enable authentication for the desired application.

B) To disable AutoEventWireup for an application, you must rewrite Page. OnLoad () instead of directly using Page_Load ()

C) Remove unused modules from the request processing pipeline. <HttpModules> nodes in the Machine. config file are activated by default. If session Status and output cache are not used in the application, you can remove them from the

8. Disable ASP. NET Debug mode

9. Other additional items: (never used, do not understand) http://dotnet.mblogger.cn/mark_lee/posts/6329.aspxseems to be the only difference between server 2003 and server.

A) Enable Gzip compression for sending data in IIS6.0. Modify the IIS6.0 xml configuration file.

B) Use the Kernel Caching of IIS6.0

C) background processing. Timer class in the System. Threading namespace. For example, submit a new post ...... Check, send an email...

10.

11.

12.

13.

14.

15.

16.

17.

18.

19.

20.

21.

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.