> > Again, in my experience, I've never seen any significant 
> > difference in these small things, compared to the differences 
> > in performance that can come from reexamining the application 
> > architecture to remove work done unnecessarily at runtime ...
> 
> It also depends on the type of application you're writing. I 
> deal mainly with back-end API's and procedures as opposed to 
> heavy user traffic, so coding using the most efficient means 
> possible is an absolute must. Some of the loops I deal with 
> iterate tens of thousands of times and are run over a thousand 
> times a day. Using cfscript as opposed to CFML for setting
> variables (even a few) can make several seconds of processing 
> go away. Granted, on normal applications that do not experience 
> much traffic (and even some that do) the differences of this 
> type are probably not paramount. For NEW code, there is no 
> reason NOT to optimize it as much as possible.

Well, I typically use CFSCRIPT to set a bunch of variables at one time,
rather than CFSET, but again, in the big picture, I don't think it makes a
significant difference. In my experience, you'd have to be setting a LOT of
variables before you could see a significant difference. I've done a decent
amount of load testing on these "which is faster" issues, just for kicks,
but very rarely come away with any clear conclusions that I'd want to stand
behind.

I'm not sure exactly what you mean by "deal[ing] mainly with back-end APIs
and procedures as opposed to heavy user traffic, so coding using the most
efficient means possible is an absolute must". Most CF applications, as
middleware, do both. In any case, there's almost always something you can
address that will make a difference exponentially larger than whether you
use CFSCRIPT or not.

It's been my experience, as one who reviews and repairs a lot of
applications, that developers focus too closely on this kind of stuff,
rather than the big issues; perhaps they do this because it's easier. I'm
not accusing you of falling into this trap, of course, but again, that's
been my experience. While I agree that when you're writing code, it's better
to write good code than bad code, I think that, in a lot of cases, there's
no significant difference in performance, while there may be a difference in
readability, and in those cases I'd favor readability or simplicity.

I guess that this is my primary concern - developers focusing on the "quick
fix" rather than on the harder, but much more important, things.

> > tweaks of this nature don't make a significant difference, 
> > and you can't rely on their behavior in future versions 
> > (or previous versions for that matter).
> 
> Eh? I wasn't aware there was a chance Macromedia was going 
> to rip cfscript out of ColdFusion, or make changes so that 
> cfoutput couldn't loop over queries. Maybe you're talking 
> about something else, but that comment makes no sense to me.

Yes, I'm talking about something else. While the functionality of CFSCRIPT,
CFOUTPUT, CFLOOP, and so on probably won't change in the next version, the
"which is faster" part certainly could change, and has changed in the past.
To illustrate that, here's a quote from Dave Carabetta earlier in this very
thread:

"However, as has been discussed here way too many times (check 
the archives), CFLOOP QUERY="" has been tuned starting with 
CF 4.01 to be faster than CFOUTPUT QUERY="". Now, there are many 
variables that play into making that statement (query size, 
etc.), but the general "rule" has been that CFLOOP QUERY="" is 
a bit faster in the latest versions of CF."

So, we've got two different ways of doing something; one of these ways used
to be faster than the other, but now their positions have been reversed,
according to this. Who's to say which will be faster under CF MX, or CF 7,
or CF 2010?

I'll be honest with you, and tell you right up front that I don't know which
is faster, in the above circumstances. Furthermore, I doubt it would make a
measurable difference from an end-user's perspective, even in a load test.

Finally, in a lot of these "which is faster" questions, there's not
necessarily one correct answer. For example, this thread started (I think)
when someone questioned whether they should use CFLOOP or CFOUTPUT to
iterate over a query. Well, my guess is that in some cases, one will be
faster, while in other cases, the other will be faster, based on
circumstances that can't be clearly categorized - that is, you can't come up
with a definitive rule saying which will be faster in which circumstances.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to