|
ASP Commandment #8: Property Reads are
Expensive
Do not fetch any values obtained via ASP/COM more than once.
Store them and use the stored values. It speeds up code significantly. Typical examples
people forget this include recordset values, request.form and request.querystring.
This is bad (3 COM calls where 1 would accomplish
same task):
<%
if rstemp("city")="Dallas" then
' do something
end if
if rstemp("city")="New York" then
' do something
end if
if rstemp("city")="New Orleans" then
' do something
end if
%>
This is good:
<%
thecity=rstemp("city")
if thecity="Dallas" then
' do something
end if
if thecity="New York" then
' do something
end if
if thecity="New Orleans" then
' do something
end if
%>
|