A small performance test in ASP. NET

Source: Internet
Author: User

We all know that the use of cache can greatly improve the Asp.net ApplicationProgramSo how much performance can be improved? I did a small test.

1. Create a new Web Application in vs2003 and add a DataGrid Control on the page to display the content of the Employees table in the northwind database in the DataGrid. My practice is to create a connection to the northwind database in the server resource manager of vs2003, and then

Drag a table to the page,

[Of course, there are other methods to connect to the database ].

In this way, sqldataconnection1 and sqldataadapter1 are automatically generated. Right-click sqldataadapter1 and click Generate dataset. The dataset dataset11 is generated according to the wizard.

2. Double-click the page to enter the. CS file (I use the C # Language). First import the namespace, and then write the following in page_load:Code:

Press F5 to view the data in the Employees table in the DataGrid Control.

3. After the test is completed, open the test tool-Microsoft Application Center Test

Open the test tool, click new project under the file to create a new test project, right-click the new test project, and complete the test according to the wizard. The cache is not used on the page. You can see the obvious difference. To use the page cache method, switch the page to the HTML code mode and add the outpurcache command on it.

For example: % @ outputcache duration = "60" varybyparam = "NONE" %

The following two figures show the comparison of results before and after the cache is used.

Before use:

After use:

Obviously, the page cache and performance are improved by more than 4 times.

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.