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.