RE: Correctly using CFOUTPUT
Great, thanks for your expertise Philip. Just what I was looking for. Can you explain this part a little more? I didn't quite get it. >If you wanted the best performance from a CFOutput query="" tag, then you >should use CFLoop query="" and only CFOutput the fields Thanks, Josh -Original Message- From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 31, 2001 2:00 PM To: CF-Talk Subject: RE: Correctly using CFOUTPUT > Hi, I've always been curious about this. What is the correct way? Does it > matter? > Is there an unwritten rule; if there are more than 4 (or ?) vars in a page > Listing 1 is a good way to do it else Listing 2 is recommended? > I'm assuming when using Listing 1 would > always be applicable. OK, there are 2 ways to look at this; 1) What's easier for you (and your team) to read and update 2) What's faster on then server when it's PCode In answer to this, Listing 1 is always easier to read, but is slower on the server "Why?" you ask (sounds of "Why?" from all over the world)... Here's how the CF Server looks at a template (if you don't have CFSetting EnableCFOutputOnly="Yes" on); It sends everything straight to the browser that's not a CF tag outside of a CFOutput without even thinking, once it reaches a CFOutput it has to scan through the code to find if anything requires any conversion from function/variable/field contents into displayable values and then converts those... When you don't have any functions/variables/fields in the code, you're effectively making CF work for nothing Remeber that a file being larger in size (before PCode) means nothing to how fast it might run on the server - it's the actual work that the server is doing that's more important If you wanted the best performance from a CFOutput query="" tag, then you should use CFLoop query="" and only CFOutput the fields Hope this helps explain why and why not to use CFOutput on everything Philip Arnold Director Certified ColdFusion Developer ASP Multimedia Limited T: +44 (0)20 8680 1133 "Websites for the real world" ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. ** ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
RE: Correctly using CFOUTPUT
Hi, let's assume that there is no query for the CFOUTPUT tag. Which would be better coding style? I've seen it done both ways: CFOUTPUTing each variable and CFOUTPUTing/encapsulating the entire template. Sometimes when I run into things I think "what do the pros do?". What would the pros do in this situation? Josh -Original Message- From: Katherine Maltby [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 29, 2001 10:00 AM To: CF-Talk Subject: RE: Correctly using CFOUTPUT It depends how you want the results to be displayed, but I'd recommend putting the cfoutput tags inside the table before the as otherwise you'll open a new table for each line of results, which isn't good if you're pulling rows and rows back from a database. Kath Web Production Director -- United Kingdom http://www.thoughtbubble.co.uk/ Ph: +44 (0) 20 7387 8890 -- New Zealand http://www.thoughtbubble.co.nz/ Ph: +64 (0) 9 488 9131 The information in this email and in any attachments is confidential and intended solely for the attention and use of the named addressee(s) . Any views or opinions presented are solely those of the author and do not necessarily represent those of Thoughtbubble. This information may be subject to legal, professional or other privilege and further distribution of it is strictly prohibited without our authority. If you are not the intended recipient, you are not authorised to disclose, copy, distribute, or retain this message. Please notify us on +44 (0) 20 7387 8890 -Original Message- From: J Winter [mailto:[EMAIL PROTECTED]] Sent: 29 May 2001 14:48 To: CF-Talk Subject: Correctly using CFOUTPUT Hi, I've always been curious about this. What is the correct way? Does it matter? Listing 1: #var1# #var2# Listing 2: #var1# #var2# Is there an unwritten rule; if there are more than 4 (or ?) vars in a page Listing 1 is a good way to do it else Listing 2 is recommended? I'm assuming when using Listing 1 would always be applicable. Thanks for any help! Josh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
Correctly using CFOUTPUT
Hi, I've always been curious about this. What is the correct way? Does it matter? Listing 1: #var1# #var2# Listing 2: #var1# #var2# Is there an unwritten rule; if there are more than 4 (or ?) vars in a page Listing 1 is a good way to do it else Listing 2 is recommended? I'm assuming when using Listing 1 would always be applicable. Thanks for any help! Josh ~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists