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

Source: Internet
Author: User
Conclusion
The first part of this article is important in the accumulation of many small things. To emphasize this, I set up a final test in which all of the actions we had tested before seemed indifferent but actually had bad effects. I have included many Response.Write declarations, turned off buffers, set the default language, removed the option Explicit reference, and initialized the error handle.
<%@ language=vbscript% >
<%
On Error Resume Next
FirstName = "John"
...
Birthdate = "1/1/1950"
Response.Write ("< HTML >")
Response.Write ("< head >")
Response.Write ("< title >response test</title >")
Response.Write ("Response.Write ("< body >")
Response.Write ("< H1 >response test

Response.Write ("< table >")
Response.Write ("< tr >< TD >< B >first name:</></td >< td >" &_
"FirstName &" </td ></tr > ")
...
Response.Write ("< tr >< TD >< B >birth date:</></td >< td >" &_
"Birthdate &" </td ></tr > ")
Response.Write ("</table >")
Response.Write ("</body >")
Response.Write ("% >
/app2/final_1.asp Fragment
Base value = 5.57 Msec/page
Reaction time = 8.85 Msec/page
difference = +3.28 msec (58.9% Increase)
It may sound obvious, but understanding is more important, and that is, the code we place on the page can have an impact on performance. Small changes on the page can sometimes greatly increase the reaction time.
Rule Summary
* Avoid excessive use of inline ASP.
* Always concatenate consecutive Response.Write statements into a single statement.
* Never use wrapper functions around Response.Write to attach CRLF.
* If you must format the HTML output, attach the CRLF directly within the Response.Write statement.
* Always open buffers via server settings.

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.