What is the best choice for improving ASP performance (ii)

Source: Internet
Author: User
Tags comments
Should buffers be turned on?
To start the buffer with a script program
When you include Response.buffer=true at the top of the ASP script, IIS caches the contents of the page.
<% OPTION EXPLICIT
Response.Buffer = True
Dim FirstName
...
Fragments of/app1/buffer__1.asp
Previous best (reaction time) = 7.05 msec/page
Reaction time = 6.08 Msec/page
difference = -0.97 msec (down 13.7%)
Performance has been greatly improved. But wait, there's a better one.
To configure the boot buffer from the server
Although the buffer is started by default in IIS 5.0, it must be manually started in IIS 4.0. To locate the Properties dialog box for the site, select the configuration button from the Home Directory tab. Then, under App options, select Enable buffering. For this test, the Response.Buffer statement was removed from the script.
The former best = 7.05 msec/page
Reaction time = 5.57 Msec/page
difference = -1.48 msec (down 21%)
At the moment, this is the quickest response we've got, which is 21% less than the time we had in the best case. From now on, our future tests will have to use this reaction time as the benchmark.
Review and observation
Buffers are a good way to improve performance, so it is necessary to set the buffer to the default value of the server. If for some reason, the page does not correctly make the buffer run, only need to response.buffer=false command. One disadvantage of buffers is that users cannot see anything from the server until the entire page is processed. As a result, it is a good idea to occasionally call a response.flush to update the user during the processing of a complex page.
Now there is another addition to our rule: always turn on the buffers through the server settings.
Should you consider adding comments to your ASP code?
Most HTML developers know that it's not a good idea to include HTML annotations, which in the first place increases the size of the data being transferred, and second, they simply provide information to other developers about your page's organization. But what about the comments on the ASP page? They never leave the server, but they do increase the size of the page, so you have to decompose it with ASP.
In this test, we added 20 comments, each with 80 characters and a total of 1600 characters.
<% OPTION EXPLICIT
'-------------------------------------------------------------------------------
... Lines ...
'-------------------------------------------------------------------------------
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.