Performance Considerations


Visual Basic .NET Unleashed
By Paul Kimmel
Table of Contents
Chapter 19.  ASP.NET Web Programming

Performance Considerations

The help topic "Developing High-Performance ASP.NET Applications" (available at ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpcondevelopinghigh-performanceaspnetapplications.htm) provides options that are worth exploring. I won't repeat that information in its entirety, but the list that follows is provided for quick reference.

  • Disable the session state unless you are using it. Add the enableSessionState= "false" attribute to the page directive to disable the session state.

  • You can store session information in a variety of in-process and out-of-process providers. An example of an in-process provider is the Session object; an example of an out-of-process provider is SQL Server. Choose your session information provider accordingly . Small data that you need quick access to can be stored with an in-process provider. If the state must be maintained even in the event of a crash, you need an out-of-process provider like SQL Server.

  • Use Page.IsPostBack to keep the number of round trips to the server to a minimum.

  • Use server controls appropriately. The Page attribute EnableViewState allows server controls to repopulate their values without your having to write code, but this feature incurs a performance penalty.

  • Multiple calls to Response.Write can concatenate strings faster than performing concatenation and having a single call to Response.Write.

  • Avoid using exceptions to control the flow of control. If you can handle an anticipated error condition, use conditional statements, but don't avoid using exceptions.

  • Declare all variables explicitly, avoiding late binding. Option Strict On will enforce this constraint.

  • Port COM components to .NET (although COM interop supports using COM components in .NET).

  • Use stored procedures for scalable data access and the SqlReader for forward-only fast data access.

  • Use output caching when possible.

  • Enable Web gardening on multiprocessor computers.

  • Build your application with debugging off before deploying it.


Visual BasicR. NET Unleashed
Visual BasicR. NET Unleashed
Year: 2001
Pages: 222 © 2008-2017.
If you may any questions please contact us: