Since when is CFLOOP "faster" then CFOUTPUT?  I have seen on this list many,
many times that CFLOOP is one of the slowest tags in CF...  I see your point
about not wanting to execute more code then is needed, but a lot of it
depends on what your doing.  But in a show down between CFOUTPUT and CFLOOP,
I say that CFOUTPUT with a query attribute beats CFLOOP hands down every
day...

-----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?
<CF_Snip>
> 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 <CFOUTPUT QUERY="q1"></CFOUTPUT> 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

Reply via email to