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.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:306400
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to