Asp.net Ajax Performance Optimization Test

Source: Internet
Author: User

Asp.net Ajax Performance Optimization Test

 

Asp.net Ajax improves performance (also applies to the Web ):

    1. Composite-reduces the number of requests
    2. Compression-Reduce request data
    3. Cache-improves the efficiency of Request Response

 

Therefore, in the optimization process, you can merge and compress the files that can be compressed, and cache the files as much as possible.

The following uses an example to illustrate how to optimize an Asp.net page so that it runs best. Of course, this is only a very low-level approach, but it is easy and practical. Suitable for beginners.

 

The following is a page for this test.

Four controls and several ajaxcontroltoolkit pages are used.CodeAs follows:

 

For the first time, the worst was not optimized.

A total of 23 requests were not cached. It took 1.4 seconds to send 16.74kb to receive 0.96m data.

This is a very bad page. Even if you refresh the page for the second time, JavaScript will not be cached.


 

For the second time, let's take a look at the two parameters to see the best results.

A total of 23 requests, all scripts are cached and compressed, and 17.70 KB is sent to receive 0.51 data, which takes seconds. This test is much better than the first one, 98% less data is returned from the server, which is very effective;


 

The third time we need to merge the Javascript of these multiple requests into one request, which can bring better results, here we need to download a scriptreferenceprofiler; http://aspnet.codeplex.com/releases/view/13356 and then drag it to your page, it will display the JavaScript-

The following is the JavaScript code

Scriptmode = "release", enablepartialrendering = "false"

The scripts provided by ajaxtoolkit are divided into debug and release. The release script removes the less characters

The test results are as follows:

A total of 9 requests, all scripts are cached and compressed and merged. It took 0.219 seconds to send 6.6kb to receive 8.21kb data. This test and the first illegal comparison were conducted;


 

The above tests hope to help you and hope you can see better optimization solutions.


 

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.