That's what I'm seeing in broad terms. I'm going to split the 3 tests up,
add in a 'counter' and storage for it and then schedule them for random
tries. After a day or so I expect the same general results with CFSCRIPT
winning over CFLOOP in 4.5.2.


> Mike,
>
> Here are the results my DEV box produced...
>
> 1000
> While: 62
> 1000
> For: 47
> 1000
> CFLoop: 78
>
> IBM NetFinity Server
> Single 750 Processor (I think)
> 512 megs RAM
>
> -----Original Message-----
> From: Michael Dinowitz [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, January 11, 2001 5:27 PM
> To: CF-Talk
> Subject: (code) Looping is faster in 4.5.2
>
>
> 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

Reply via email to