Yeah - I checked that...
ran it again:
CF-33671
While - 27625
do-18782
must have been some other factor...
-----Original Message-----
From: Garza, Jeff [mailto:[EMAIL PROTECTED]]
Sent: 13 March 2001 18:49
To: CF-Talk
Subject: RE: (Review) Conditional loops
Me thinks you are wrong... Did you remember to change the loop count in the
CFLOOP to 1,000,000 as well? Your results are awfully close to those of the
100,000 group.
1,000,000 on my machine... PIII 600MHz 782MB RAM
***********************
CF-44063
While - 28562
do-25297
These results are inline with all the others. Twice as fast in CFSCRIPT.
***************************
Jeff Garza
Web Developer/Webmaster
Spectrum Astro, Inc.
480.892.8200
[EMAIL PROTECTED]
http://www.spectrumastro.com
-----Original Message-----
From: Daniel Lancelot [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 11:37 AM
To: CF-Talk
Subject: RE: (Review) Conditional loops
What do make of this then???
CFLOOP is (fairly substantially) quicker when you have 1,000,000
repetitions...
1,000,000 repetitions:
====================
CF-34781
While - 50079
do-50391
100,000 repetitions:
===================
CF-3360
While - 1859
do-1813
10,000 repetitions:
==================
CF-343
While - 172
do-188
1,000 repetitions:
====================
CF-46
While - 16
do-16
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 13 March 2001 18:26
To: CF-Talk
Subject: (Review) Conditional loops
I just did some more tests and I've got some more interesting results. The
test
was to compare conditional loops between the CFLOOP and the two conditional
loops in CFSCRIPT (while and do-while). My tests showed that the CFSCRIPT
statments were about twice as fast as the CFLOOP statment. This was my
expected
results. It looks like the only loop that is faster outside of CFSCRIPT is
the
for loop (from-to).
For those who want to test my code and see my results, I've pasted it below.
To
do a real test, try a loop count of 1000, 10000 or even higher.
<CFSET loopcount=0>
<CFSET start=GetTickCount()>
<CFLOOP condition="loopcount LTE 1000">
<CFSET loopcount=loopcount+1>
</CFLOOP>
<CFSET cf=gettickcount()-start>
<BR>
<CFSET loopcount=0>
<CFSET start=GetTickCount()>
<CFSCRIPT>
while (loopcount LTE 1000)
loopcount=loopcount+1;
</CFSCRIPT>
<CFSET wh=gettickcount()-start>
<BR>
<CFSET loopcount=0>
<CFSET start=GetTickCount()>
<CFSCRIPT>
do
loopcount=loopcount+1;
while (loopcount LTE 1000);
</CFSCRIPT>
<CFSET do=gettickcount()-start>
<HR>
<CFOUTPUT>
CF-#cf#<BR>
While - #wh#<BR>
do-#do#
</CFOUTPUT>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists