Use variables to speed up collection access
Whenever you access a collection such as Request.ServerVariables or Request.Form, the script processor needs to go
into the collection to look up the value of the item you request. While this doesn't seem like it takes a long
time, it's actually relatively slow when compared to accessing local variables.
If you find yourself using the same item from a collection more than a couple times, declare a local variable and
assign the value of the item in the collection to it the first time you need to access it. From then on you can
use the local variable to retrieve the value to prevent the computer from needing to access the collection again.
The same thing goes for things like the field object of a recordset. Using a local variable saves the collection
lookup time and while it may seem trivial, think about some of the loops that you're doing it inside of. A little
bit of inefficiency adds up all of a sudden when you consider the number of times you're doing it!
You won't notice a huge speed increase. In fact, you probably won't even be able to tell the difference, but on
a high traffic site the small amount of time saved each time the page is run can really add up.