Hello,

My *guess* as to how CF handles it is to use a flag to determine if it has been set 
already - if this flag is set don't bother checking and/or setting the variable again. 
The flags
could be stored in a fast access location rather than a variable look up/variable 
verification in memory somewhere.

On another note though using a straight CFSET will wipe out anything that you might 
have wanted to store in that variable and set it to that value (assuming this is done 
in the
Application.cfm file). There may be instances where a variables value will be modified 
during program execution. In this case an CFIF conditional guard would be required.

just my 20 centavos worth ;)

Nelson


Todd Ashworth wrote:

> I'm not sure .. anyone else have an opinion?
>
> Todd Ashworth
>
> ----- Original Message -----
> From: Kym Kovan <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, July 04, 2000 7:46 AM
> Subject: Re: What am I doing wrong?
>
> > Hi Todd,
> >
> > >If you use <cfset> in the Application.cfm file, the <cfset> gets executed
> > >every time a page is loaded, regardless if the variable already has its
> > >value or not.  If you use <cfparam name="application.datasource"
> > >default="mydsn">, the variable is only set if it doesn't already exist.
> I
> > >would guess this provides a slight performance increase which could
> really
> > >add up under heavy use.
> >
> > I wonder about that. <cfparam has to check for the existance of a
> variable,
> > then sets it if it is not there, <cfset just plain sets it.
> >
> > If we are talking template level variables then the <cfset is obviously
> > faster but at the application or server level scopes then which is faster
> a
> > check or a set? First time round the variable has to be set, but after
> that?
> >
> >
> >
> > --
> >
> > Yours,
> >
> > Kym
> > --------------------------------------------------------------------------
> ----
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
> send a message to [EMAIL PROTECTED] with 'unsubscribe' in
> the body.
> >
>
> ------------------------------------------------------------------------------
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit 
>http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
>message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to