Simon, it's true that using local scopes makes the server set the variable for
each page request, thereby consuming resources. However, doesn't locking all
references to the application scope also consume resources? And the application
scope is stored in server memory, which also consumes resources. The fact of the
matter is that using variables at all consumes resources, so there must be a
happy medium somewhere. I guess the real question is "which results in better
performance, locking application variables only once or twice per page view and
converting them to the request scope to be read, or not converting them at all
and having to use cflock whenever you need to reference one of the variables?".

Any thoughts?

- Bruce

> -----Original Message-----
> From: Simon Horwith [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 11, 2000 1:21 PM
> To: CF-Talk
> Subject: RE: Application.variables vs local.variables
>
>
> by checking for an application variable and setting the DSN to an
> application scoped variable in the event that the variable does not exist,
> you require the CFAS to set the variable only every once in a while, rather
> than everytime a page is requested.  This is ideal from a performance point
> of view.
>
> ~Simon
>
> > Simon Horwith
> > Certified ColdFusion Developer
> > Fig Leaf Software
> > 1400 16th St NW, # 220
> > Washington DC 20036
> > 202.797.6570 (direct line)
> > www.figleaf.com
> >
>
>
> -----Original Message-----
> From: Mike [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 11, 2000 5:08 PM
> To: CF-Talk
> Subject: Application.variables vs local.variables
>
>
> Is it better to set an application variable in the application file rather
> than just setting a local variable especially for a variable that's not
> going to change such as local.dsn then you do not have to lock reads
>
> or lock read and assign local.dsn equal to application.dsn
>
> or just lock all read of application.dsn
>
> Most importantly why would one be better ?
>
> It seem to me it might be best just to set local.dsn in the application file
> and have done with it.
>
> I'm not talking about variables that have change like counter or something
> of that nature.
>
> thanks Mike
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        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