yeah -- i tried that a week ago just for the heck of it and was utterly
surprised to find out that cfscript loops execute about 25-30% slower on my
4.5.1 box. haven't benchmarked on the 4.0 servers yet...
At 06:26 PM 1/11/2001 -0500, you wrote:
>In the past both myself and many others have written and said how CFLOOP is
>faster and more efficient than the loops within CFSCRIPT. I was just doing
>some tests and found that this is no longer true. It seems that as of CF
>4.5.2, CFSCRIPT loops are the more efficient loops with the for loop looking
>slightly better than the while loop. These are my findings, but I'd like
>others to play with this as well and give me their results. Below is my test
>code. Each section is as exact in comparison to the others as I can make it.
>
><CFSET start=GetTickCount()>
><CFSCRIPT>
> i=1;
> While (i LTE 1000){
> test=i;
> test2=test+i;
> i=i+1;
> }
> WriteOutput(test);
></CFSCRIPT>
><BR>
>While: <CFSET WriteoutPut(gettickcount()-start)>
><BR>
>
><CFSET start=GetTickCount()>
><CFSCRIPT>
> for(i=1; i LTE 1000; i = i + 1){
> test=i;
> test2=test+i;
> }
> WriteOutput(test);
></CFSCRIPT>
>
><BR>
>For: <CFSET WriteoutPut(gettickcount()-start)>
><BR>
><CFSET start=GetTickCount()>
><CFLOOP from="1" to="1000" index="i">
> <CFSET test=i>
> <CFSET test2=test+i>
></CFLOOP>
><CFSET WriteOutput(test)>
><BR>
>CFLoop: <CFSET WriteoutPut(gettickcount()-start)>
><BR>
>
>Michael Dinowitz
>Publisher: Fusion Authority weekly news alert
>(www.fusionauthority.com/alert)
>Listmaster: CF-Talk, CF-Jobs, Spectra-Talk, Jrun-Talk, etc.
>(www.houseoffusion.com)
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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