>- see footer for list info -<
Well there is a pre-scan on compilation, because as charlie says, CF detects
if you have repeated case values.
But when it comes to run-time then the processing of the cases should stop
when you find a match.

You can test this yourself by checking your execution times.
Move the matched case from the top to the bottom of the switch/case
statement and test each.
You will probably have to loop over it a few times to notice a difference.

Russ

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jolly Green Giant
Sent: 07 August 2006 17:20
To: Coldfusion Development
Subject: Re: [CF-Dev] CFSwitch... Aren't all cases evaluated?

>- see footer for list info -<
It is the "Tip" on page 26 of the MX7 book.

"As with /cfif/, it is best to put the most common cases at the top of the
/cfswitch/ to increase performance."

So what I hear you saying is that it doesn't matter where in the /cfswitch/
the hit is, because it's doing a "prescan" anyway.  That right?
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help 
>-<


_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to