> I shall see if I can dig out my old tests, if I still have them, and we
> can compare notes. But: tomorrow.
I ran a quick test this morning....did the following:
<cfsilent>
<cfset i = "50000">
<cftimer>
<cfloop from="1" to="#i#" index="i">
<cfset foo = randRange(0,1)>
<cfset bigRandom = randRange(10000,20000) />
<cfset bar = iif(foo, "foo + bigRandom", "foo + bigRandom") />
</cfloop>
</cftimer>
</cfsilent>
VS.
<cfsilent>
<cfset i = "50000">
<cftimer>
<cfloop from="1" to="#i#" index="i">
<cfset foo = randRange(0,1)>
<cfset bigRandom = randRange(10000,20000) />
<cfif foo>
<cfset bar = foo + bigRandom />
<cfelse>
<cfset bar = foo + bigRandom />
</cfif>
</cfloop>
</cftimer>
</cfsilent>
Results:
i = 1000: To small to measure
i = 10000: <cfif> ran about 2x as fast
i = 25000: <cfif> ran about 2.5x - 3x as fast
i = 50000: <cfif> ran about 2x - 2.5x as fast
i = 75000: <cfif> ran about 2x as fast
i = 100000: <cfif> ran about 2x as fast
i = 200000: <cfif> ran about 2.2x as fast
Notes:
This test isn't scientific in any way. I ran it ad-hoc on my laptop
and an idle server.
I used the bigRandom to defeat any caching of string to be evaluated
that the CF engine may perform.
-Joe
--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]