> Does anyone out there have a webpage they've put together or a list of
> different CF performance tests that they've run for individual elements in
> CF (like <CFLOOP...> vs. <CFOUTPUT query="myquery"> or other tag
> comparisons, best practice standards, etc.)?
There are so many variables which effect speed, I doubt I could list them
all without breaking most people's email size limit <g> Here's some to be
getting on with...
It really depends on what you're doing within the CFOutput or CFLoop
If you're only setting variables, then never eeeeever use CFOutput
If you're doing loads of field output then use CFOutput
If you're using the Group attribute, then you can't use CFLoop
If you're running CF4.5.1SP2 then CFScript is faster for loops than CFLoop,
otherwise CFLoop is faster
Using unnecessary #s slows down the compilation time
Not turning on Trusted Cache slows down the template time
Not using cached queries slows down data return
On top of that, different variable types are faster than others - Arrays are
faster than Lists, Structures in Arrays are easy to work with, but
(slightly) slower than 2D+ arrays (as it has to look-up the position in the
structure while 2D points to the exact location)
In general though;
Use CFOutput only for outputting
CFOutput around a whole page is slower than individual ones
If on the latest CF, use CFScript as much as possible where you're doing
more than 3 instructions that don't require a CF tag (like CFQuery, CFFile,
CFOutput etc.)
IIF() is still slower than doing if() or CFIF
There are 2 schools of thought on CFSetting EnableCFOutputOnly - it slows
down the page generation, but it makes the output come to the client
faster - your choice on which one you want - if you're using CFScript a lot,
then it's not 100% necessary as there is little white-space
CF_ is slower than CFModule, which is slower than CFInclude
You could spend weeks trimming down an app for 10 or 20 ms where just
checking on Debug which template is the slowest may point to where your
problem is... the only problem with that is recursion - it totals the time
spent on the template to give you the time... oh, and recursion is slow as
well
I know I rambled a bit, but I hope this helps
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists