|
We’ve already been over this, but
this can have performance implications when used with highly iterative
operations. Consider this (contrived, but simple) example: function add(a, b) { var
local = StructNew(); local.result
= arguments.a + arguments.b; return
local.result; } Now if you’re running that in a loop
like so: <cfloop from=”1” to=”10000”
index=”i”> <cfset
result = add(i, 100)> </cfloop> You’ve just created and destroyed
10,000 structs!!! That’s a heck of a lot of object creation and
garbage collection. It really depends on the application as to whether or
not it is something to be concerned about, however, since in most applications,
this type of massive iteration does not really occur. Roland From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim Davis You might also create a pseudo scope to
get around this. I do <cfset var local = structnew()
/> at the top of every method. Then later instead of doing
“<cfset var sFacade …. />” you can do “<cfset
local.sFacade … />” Doing this also offers the benefit of
being able to dump the local “scope” for debugging. Jim Davis You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected] ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com). An archive of the CFCDev list is available at www.mail-archive.com/[email protected] |
- RE: [CFCDev] Scoping Error Billings, Brian J. (SMG)
- Re: [CFCDev] Scoping Error Matt Woodward
- Re: [CFCDev] Scoping Error Aaron Rouse
- RE: [CFCDev] Scoping Error Jim Davis
- [CFCDev] What is this anyone Andrew Scott
- Re: [CFCDev] What is this anyone Nathan Strutz
- Re: [CFCDev] What is this anyone Thomas Chiverton
- Re: [CFCDev] What is this anyone Cliff Meyers
- RE: [CFCDev] Scoping Error Billings, Brian J. (SMG)
- RE: [CFCDev] Scoping Error Roland Collins
- Re: [CFCDev] Scoping Error Cliff Meyers
- RE: [CFCDev] Scoping Error Jim Davis
- RE: [CFCDev] Scoping Error Roland Collins
