******************************* Team Allaire *******************************
> 1) It is possible to execute a block of code for more than one value.
Very cute hack. Mind if I steal it for my docs on CFSCRIPT?

> <cfscript>
> switch ( foo ) {
> case 1 :
> case 2 : {
> // code
> break;
>
> 2) What is the basis of the statement that says <cfswitch> / <cfcase> is
> twice as fast switch / case? Is the test code equivalent?  Has anyone
> talked to one of Allaire's programmers about their implementation of
> this code? Are you already in a cfscript statement? Or are you starting
> a new cfscript block?

I tried each case.
1. a CFLOOP over a CFSWITCH
2. A CFLOOP over a CFSCRIPT switch
3. A CFSCRIPT for loop over a switch
I've redone my tests and have better numbers. In the CFSWITCH case we have a
speed of 80ms for CFSWITCH statements that have values or numbers or
letters. In the CFSCRIPT switch statement, a time of 140 ms was achieved for
cases where there were only numeric values. When letter values were allowed
in cases, the time went up to 800ms. A very dramatic shift. One note is that
there was almost no difference in having the loop inside the CFSCRIPT block
or outside.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to