>I know that the prevailing wisdom is that CFOUTPUT with the Query attribute >is faster than CFLOOPing over a query. However, in Forta's CF 5 >Certification Study Guide, he states that CFLOOP performs better (p. 37 and >374). Has CF 5 improved the performance of CFLOOP (Steve Drcuker referred >to >it as the "CF tag of death" in CF 3) so that it performs better than >CFOUTPUT with a query attribute?
First off, the cf-talk archive has a ton of threads, a lot of them very recent on this subject. I would definitely look there. But to answer your question...it depends. For a small record set, the performance difference is negligible. However, starting with CF 4.01 (may have been 4.0), CFLOOP was tuned to perform better with larger record sets. Yes, it was the "CF tag of death" in CF 3.1 and below. But it now is the speedier of the two methods. Plus, you have the added benefit of being able to nest loops (which allows you to nest record sets if you wish), and you can significantly reduce whitespace by only outputting necessary variables as opposed to large blocks of code with CF tags mixed in. Remember, 2 or 3 lines of whitespace per loop can add up quickly in larger record sets. CFOUTPUT has the advantage of being able to use attributes such as GROUP, STARTROW, MAXROWS, and GROUPCASESENSITIVE. CFLOOP is a "dumb" tag, in that it accepts the query name (in this instance) and then just loops until there are no more records. CFOUTPUT is more intelligent, and thus a little more costly, because it examines the results of the record set for start rows, end rows, etc. Personally, I use CFLOOP QUERY="" in my code and then only output what needs to be output. The processing time that I save by using a "dumb tag" and eliminating unnecessary whitespace is important to me. But you will find that there are some people who swear by using CFOUTPUT QUERY="". When it comes to grouping and stuff, more often than not, I can take care of that in my SQL statement. Hope this sheds some light for you. Regards, Dave Carabetta. _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com ______________________________________________________________________ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation · $99/Month · Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists