[thelist] ColdFusion Application Variables

Seth Bienek evolt.list at sethbienek.com
Thu Feb 6 09:40:01 CST 2003


> -----Original Message-----
-snip-
> I'm wondering if there is a performance increase by using
> Applicaiton variables versus creating a structure for each
> page to hold the variables.  Is there an even better way to
> do it?  These variables are the same across the whole
> site/application and won't be changed often (if it all).  It
> seems to me that it would be more work for CF to recreate the
> structure on each page than it would be to hold the
> Application variable and call it each time.
-snip-

I have an addendum to this question; kind of along the same lines.  I've
been storing application variables on app initialization, then have the
following code in my Application.cfm:

<cflock scope="application" type="readonly" timeout="5">
	<cfset StructAppend(request, application)>
</cflock>

Basically, copying the app variables into the request scope.  This
eliminates the locking issues, but at what cost?  Is CF creating a
pointer to the application variables, or is it actually copying the
Application structure's contents into the request structure, and is this
a performance-affecting technique?  If anyone knows offhand, I'd be much
obliged; otherwise, I suppose some testing is in order.

Thanks,

Seth




More information about the thelist mailing list