[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
ASPFAQ_OptimizationTips
This page contains tips on how you can make your ASP WEB-site faster.
You can disable session state by adding the following to the top of the page:
Because that will eliminate bugs due to mis-spelling of variable names. Option Explicit requires that all variables are declared using the "dim" statement before they can be used. It also improves the page's performance by up to 10% according to some tests.
Here's a example
Using ordinal number is specially efficient to use inside loop.
You can here find a good article about this.
You can find more information about this here
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
ASPFAQ_OptimizationTips
ASP Optimization Tips
Back to ASP FAQ Main Page.This page contains tips on how you can make your ASP WEB-site faster.
Disable Session State
Does your .ASP page require session state? If not it's wise to disable session state for all .ASP pages that does not need session state.You can disable session state by adding the following to the top of the page:
<%@ ENABLESESSIONSTATE=false %>
Always use Option Explicit
Always start your ASP page with the following line<% Option Explicit %>
Because that will eliminate bugs due to mis-spelling of variable names. Option Explicit requires that all variables are declared using the "dim" statement before they can be used. It also improves the page's performance by up to 10% according to some tests.
Disable ASP Server-side Debugging
Make sure that the ASP server-side script debugging is disabled on your production server because that will otherwise slow down the your server. If you enable ASP-debugging the application will be locked to a single execution thread. You can disable it in the Application Configuration window that you will find in the IIS property page.Use local variables
Using variables defined inside functions or subroutines are faster than global variables.Use the ordinal form when accessing recordset fields
Its faster to refer to a field value in a recordset using its ordinal number instead of its name. The ordinal number represent the column number in the record and the number starts counting from zero. By refering to it by name a extra lookup has to be performed every time its accessed.Here's a example
'Using the slower name to refer to a field value
Response.write "Hello " & Rs("Hame")
'Using the faster ordinal number (asuming that the number is 1)
Response.write "Hello " & Rs(1)
Using ordinal number is specially efficient to use inside loop.
You can here find a good article about this.
Use the Recordset's .CacheSize property
If you are retrieving more than one record from your database you might gain some extra performance by setting the Recordset's .CacheSize property to a suitable level. A suitable level depends on your application and the type of query you are making.You can find more information about this here
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
