Monday, October 09, 2006

Improving ASP Performance Tip #1

Assign opbject variables to local variables.

Reading from the object variable is slower than reading from the local variable. So if you're going to be using the object variable frequently, store it in a local variable and access it that way.

Slower:
If Object.Value = 0 then
Do something
elseif Object.Value > 0 then
Do something
elseif Object.Value
etc...
Faster:
Dim vObject

vObject = Object.Value

if vObject = 0 then
Do something
elseif vObject > 0 then
Do something
elseif vObject <> etc...


No comments: