Search This Blog

Monday, July 31, 2006

ASP Tips to Improve Performance and Style

Performance is a feature. You need to design for performance up front, or you get to rewrite your application later on. That said, what are some good strategies for maximizing the performance of your Active Server Pages (ASP) application?

This article presents tips for optimizing ASP applications and Visual Basic® Scripting Edition (VBScript). Many traps and pitfalls are discussed. The suggestions listed in this article have been tested on and other sites, and work very well. This article assumes that you have a basic understanding of ASP development, including VBScript and/or JScript, ASP Applications, ASP Sessions, and the other ASP intrinsic objects (Request, Response, and Server).

Often, ASP performance depends on much more than the ASP code itself. Rather than cover all wisdom in one article, we list performance-related resources at the end. These links cover both ASP and non-ASP topics, including ActiveX® Data Objects (ADO), Component Object Model (COM), databases, and Internet Information Server (IIS) configuration. These are some of our favorite links-be sure to give them a look.

  1. Cache Frequently-Used Data on the Web Server
  2. Cache Frequently-Used Data in the Application or Session Objects
  3. Cache Data and HTML on the Web Server's Disks
  4. Avoid Caching Non-Agile Components in the Application or Session Objects
  5. Do Not Cache Database Connections in the Application or Session Objects and Using the Session Object Wisely
  6. Encapsulate Code in COM Objects & Acquire Resources Late, Release Early
  7. Out-of-Process Execution Trades off Performance for Reliability
  8. Option Explicit, Local Variables and Script Variables
  9. Avoid Redimensioning Arrays
  10. Use Response Buffering
  11. Batch Inline Script and Response.Write Statements
  12. Check Connection, Using the OBJECT Tag, TypeLib Declarations
  13. Take Advantage of Your Browser's Validation Abilities & Enable Browser and Proxy Caching
  14. Avoid String Concatenation in Loops
  15. More on Fine Tuning

Len Cardinal
Senior Consultant, Microsoft Consulting Services
George V. Reilly
Microsoft IIS Performance Lead

Adapted from an article by Nancy Cluts
Developer Technology Engineer
Microsoft Corporation

Original Resource:

No comments: