cf-talk  

Re: scoping and speed

Charlie Griefer
Thu, 10 Dec 2009 08:07:33 -0800

In theory, yes, as ColdFusion will have to hunt through the various scopes
to find the exact variable that you're referencing.

Whether it's noticeable or not.. hard to say.

>From the CF8 docs (
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Variables_32.html
):

"Because ColdFusion must search for variables when you do not specify the
scope, you can improve performance by specifying the scope for all
variables."

I do actually recall hearing that on Railo, it was faster to -not- scope
local variables.  Not sure if that still holds true or not.

On Thu, Dec 10, 2009 at 7:13 AM, Chad Gray <cg...@careyweb.com> wrote:

>
> If you don't scope your local variables does the page run slower?
>
> IE. #variables.foo# vs. #foo#
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329047
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4