Asp Performance Tips
Posted on 12 Aug 1999
by Martin Burns (MartinB)
Rated 3.92 (Ratings: 2)
- More articles in Backend
- Retrieving values from collections is relatively slow. Store retrievedvalues in local variables if you need to access them more than once.
- Avoid using server-side
#includedirectives to include large lists ofconstants.
- Use the new
<METADATA>tag to import type-library constants intoglobal.asa.
- Avoid using
- Group multiple Response.Write statements, and delimit them with one set of
- Avoid redimensioning VBScript arrays.
- Use only one scripting language per page.
- Buffered responses (Response.Buffer=True) are faster than unbuffered ones(although they can appear less responsive).
Response.IsClientConnectedduring the processing of long scripts. Thisproperty determines if the client has disconnected from the server since thelast
Response.Write, and improves application responsiveness during times ofpeak usage.
- Use components to encapsulate business logic rather than complex script.
Convert dynamic ASP output to static HTML using the ASP2HTM componentwherever possible. (ASP2HTM is included on the Internet Information Server(IIS) Resource Kit CD.)
- Store commonly requested, unchanging content in memory using anapplication-scope Dictionary object. Avoid using Session_OnEnd event procedures, if possible.
- Disable the Session object on a page-by-page basis with the
<%@EnableSessionState=False %>statement. This declarative allows ASP toprocess scripts concurrently, rather than sequentially.
- Write client scripts that don't require roundtrips to the server. Distributework to the client, such as form input validation. Use the BrowserCapabilities component (MSWC.BrowserType) and customize client-side scriptsto take advantage of the browser, incorporating such technologies as DHTML,client-side script, and ActiveX? controls.
- Focus your optimization efforts on the most common paths through your siteor application. You can determine user behavior with IIS service logs andthe Usage Import and Report Writer component of Site Server Express.
Response.Expiresappropriately so that proxy servers can intelligentlycache information that doesn't change often.
- Optimize the use of ADO Connection objects, with ODBC connection pooling andstored procedures.
- Measure system performance with tools such as Task Manager, NetMon, andPerfMon. Measure Web capacity with WCAT. Profile portions of your ASP scriptwith the ASP Tracer component. For more information see the IIS ResourceKit.
- Try to keep one ASP page to One application.Use SQL stored procedures wherever possible.
These tips are culled from MSDN, where there may be even more.