thanks dominic,

I ran your code and the results between setting variable blocks with cfscript 
or using cfset varied from trial to trial. Some times cfscript was faster, 
other times cfset.

Anyhow in a nutshell it confirms my initial idea, that it isn't really a major 
issue. In the end it depends on personal style, readability and other user 
factors as to which is preferred when setting large blocks of variables..

regards,
larry

>I ran your code a few times on my machine (XP Pro) and got varying
>results; sometimes the cfscript was faster, sometimes cfset. Try this
>code out instead, it performs a single test on both cfscript and cfset
>for each iteration and records a tally of the time taken for each -
>this spreads the test and reduces variance due to the varying state of
>the computers processor, etc. So far I always have cfscript as
>slightly faster:
>
><cfset iterations = 1000000/>
><cfset scriptTotal = 0>
><cfset cfsetTotal = 0>
><cfset scriptResult = 0 />
><cfset cfsetResult = 0 />
>
><cfloop from="1" to="#iterations#" index="i">
>       <cfset tick = getTickCount()>
>       <cfset cfsetResult = cfsetResult + i />
>       <cfset cfsetTotal = cfsetTotal + (getTickCount() - tick)>
>       
>       <cfscript>
>                tick = getTickCount();
>                scriptResult = scriptResult + i;
>                scriptTotal = scriptTotal + (getTickCount() - tick);
>       </cfscript>
></cfloop>
>
><fieldset>
>       <legend>CFSCRIPT</legend>
>       <p><cfoutput>#scriptResult#</cfoutput><br/>
>       <cfoutput>Execution Time: #scriptTotal#ms</cfoutput></p>
></fieldset>
>
><fieldset>
>       <legend>CFSET</legend>
>       <p><cfoutput>#cfsetResult#</cfoutput><br/>
>       <cfoutput>Execution Time: #cfsetTotal#ms</cfoutput></p>
></fieldset>
>
>Dominic
>> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308481
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to