Seems to me no-ones 100% sure..................... Â Â Â Â Â I've found cfloop to execute better overall in most situations when I am
working with very large amounts of data, Chris. I don't generally see much
difference in execution time between the two, in any other situation (and
cfoutput with a query attribute IS easier to use if it suits your needs)
~Simon
------------------------------------------
Personally, use what you like. I have not found any measurable difference in
performance between CFOUTPUT and CFLOOP.
If performance becomes an issue, try to resolve it then. But usually by the
time you sling manhours on it, you can upgrade to faster processor for less
money. Sad but true.
Ray Thompson
------------------------------------------------
I just remembered where I read that cfloops are more effiecient than
cfoutput with queries, in ben forta's coldfusion developers study guide, if
that helps clarify anything
mark
-----------------------------------------------------
Hmmm,
You know, this was beaten into our heads a couple of years ago, so much so that
I tend to jump at it (i.e. the last email). Perhaps it is time to reasses this
assumption. I do recall Allaire stating it, but I don't recall the context.
Mike Dinowitz, are you on the list today? I know you have definitive opinions
on this, or at least you did a couple of years ago.
I also recall Hal Helms debunking the difference. The funny thing was, I also
recall an Allaire speaker describing why CFOUTPUT was faster for query outputs,
but don't remember the details.
Curious...
Chris Graves, CCFD
RapidCF
--------------------------------------------------------------------
I think I read somewhere that cfloop is more efficient than cfoutput with
4.5, previous to this cfoutput was more efficient
If i'm wrong i'll soon be corrected :)
mark
------------------------------------------------------------------------
Â
And now to inject a little more uncertainty...
Just a couple of months ago an Allaire consultant told me that cfloop was
the second slowest tag after cfmail. Always use cfoutput to output queries.
I imagine he was speaking relatively though. I can think of some really slow
tags.
jon
---------------------------------------------------------------------------- --
This is from the Certified ColdFusion Developer Study Guide:
pg 37 Tip #1
<crit_quote>
The function of the query loop is the same as using <cfoutput> with a query attribute. For
performance reasons, use a Query loop rather than a <CFOUTPUT query="qAny"> loop. Before
ColdFusion 4.x, the <CFoutput query="qAny"> query loop performed better.
Generally speaking you should use a <cfloop> with a query attribute when doing all, or
mostly, processing in the loop. If there is nothing in the loop but display, use
<cfoutput>
Â
</crit_quote>
So what's right?
---------------------------------------------------------------------------- -----------------------
Well thats a bit misleading........the more processing you do within a loop,
the slower its going to be, no matter the looping method. For pure looping,
I remember hearing from somewhere that CFLOOP was actually faster, all other
things being equal. I remember being somewhat surprised by this.
---------------------------------------------------------------------------- -------------------------------
Well thats a bit misleading........the more processing you do within a loop,
the slower its going to be, no matter the looping method. For pure looping,
I remember hearing from somewhere that CFLOOP was actually faster, all other
things being equal. I remember being somewhat surprised by this.
---------------------------------------------------------------------------- --------------------------
fcourse cfoutput,
that's why it doesn't allow alot of tags to be typed into it.
it's much more faster then CFLOOP, which lets you specify every cf tag you
want (CFMAIL, for example)
Â
Thanks,
Michael Lugassy