Awesome info/links Charlie and Barney! To quote the Adobe CF8 livedocs reference: "The cfswitch tag provides better performance than a series of cfif/cfelseif tags, and the code is easier to read."
I guess the moral to this is, 'don't treat everything you find on the official docs as gospel'. :-) > -----Original Message----- > From: Charlie Griefer [mailto:[EMAIL PROTECTED] > Sent: Friday, May 30, 2008 10:42 AM > To: CF-Talk > Subject: Re: How is cfswitch better that cfif? > > the webapper folks had an interesting blog post in the subject as well... > > http://www.webapper.net/index.cfm/2006/7/27/20060727042244 > > altho it seems that the issue they address was resolved in CF8. > > still, an interesting read :) > > On Fri, May 30, 2008 at 10:38 AM, Barney Boisvert <[EMAIL PROTECTED]> > wrote: > > Here's the link to my post from back then. Figured I could do the > > googling and save everyone else the trouble: > > > > http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:152825 > > > > On Fri, May 30, 2008 at 10:36 AM, Barney Boisvert <[EMAIL PROTECTED]> > wrote: > >> That was a rumor a few years ago, because switch frequently performs > >> better in lower-level languages because of reduced expression > >> evaluation. I did some testing and found that the opposite is true in > >> CF: CFIF performs better than CFSWITCH. Not all conditionals can use > >> CFSWITCH, of course, but for the ones that can use both. It was a > >> while go, probably on CF 6.1. > >> > >> That being said, if you care about the performance difference between > >> the two (it fractions of a milliseconds), then using CF is the wrong > >> choice, because CF is optimized for developer productivity over raw > >> performance. If you care about shaving a millisecond or two off your > >> request times, optimize your DB, add caching, check for any "silly" > >> algorithms (query w/in a loop where a JOIN would work, etc.). Then > >> tune your JVM. Then buy more hardware. Then switch from CF to a > >> lower-level language. Then, and only then, can you switch from if > >> statements to switch statements. > >> > >> cheers, > >> barneyb > >> > >> On Fri, May 30, 2008 at 10:23 AM, Mike Francisco <[EMAIL PROTECTED]> > wrote: > >>> Alot docs I've read says that cfswitch performs better than cfif. > Does > >>> anyone know in what way? How would it be better if both tags are > processed > >>> by the CF server engine anyway. I wanted to justify if it is worth > the > >>> effort of rewriting some of my code to improve the performance of my > app > >>> that uses cfif quite extensively. A better understanding would surely > help > >>> me decide. Thanks in advance. > >>> > >> > >> > >> -- > >> Barney Boisvert > >> [EMAIL PROTECTED] > >> http://www.barneyb.com/ > >> > >> Got Gmail? I have 100 invites. > >> > > > > > > > > -- > > Barney Boisvert > > [EMAIL PROTECTED] > > http://www.barneyb.com/ > > > > Got Gmail? I have 100 invites. > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:306413 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

