Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is there a processing difference in...

Status
Not open for further replies.

daNewfie

Programmer
Joined
Oct 14, 2004
Messages
258
Location
CA
using

<cfoutput>#myQuery.Item1#</cfoutput>
<cfoutput>#myQuery.Item2#</cfoutput>
<cfoutput>#myQuery.Item3#</cfoutput>
<cfoutput>#myQuery.Item4#</cfoutput>

vs

<cfoutput query="myQuery>
#myQuery.Item1#
#myQuery.Item2#
#myQuery.Item3#
#myQuery.Item4#
</cfoutput>
 
you can do
<cfset myStart = GetTickCount()>
<cfoutput>...</cfoutput>
....
<cfset myStop = GetTickCount()>
<cfset myTime = myStop - myStart>
<cfoutput>#myTime#</cfoutput>

<cfset myStart = GetTickCount()>
<cfoutput query="myQuery>
#myQuery.Item1#
#myQuery.Item2#
#myQuery.Item3#
#myQuery.Item4#
</cfoutput>
<cfset myStop = GetTickCount()>
<cfset myTime = myStop - myStart>
<cfoutput>#myTime#</cfoutput>

and see which one is faster. my quess is the second one is going to be faster ...
hope it helps..

 
there's a huge difference!

the first will print 4 values (from the current row of the query results)

the second will print 4 values as many times as there are rows in the query results

the only time it ever comes close is when the query returns only one row

:-)

r937.com | rudy.ca
 
<cfset myStop = GetTickCount()>
<cfset myTime = myStop - myStart>
<cfoutput>#myTime#</cfoutput>

Or

<cfoutput>#GetTickCount() - mystart#</cfoutput>

Just funny because I found myself doing all kinds of things like that the other day, and once was actually exactly this situation!

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top