Yes, there is a HUGE difference.  Check my post about it here:
http://www.barneyb.com/blog/archives/000496.jsp

In a nutshell, the CFPARAM tag will execute the 'default' attribute
whether the result will be used or not, so if you use the CFPARAM
method, you'll be instantiating your 'message' component on every
request, and then immediately throwing the instance away, since you
don't actually need to set the application.message variable.

So not only will it be less performant to use CFPARAM, it'll also
potentially lead to very subtle bugs if your component initialization
code takes any actions, because they'll happen every request, even you
only initialize the application variable a single time.

cheers,
barneyb

On 6/11/05, Johnny Le <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Is there a performance difference between this?
> 
> <cfif not structKeyExists(application, "message")>
> <cfset application.message = createObject("component", "message").init()/>
> </cfif>
> 
> and
> 
> <cfparam name="application.message" default="#createObject('component', 
> 'message').init()#"/>
> 
> The cfparam method seems to be much cleaner, but most people seem to use the 
> cfif method.  Is there a reason for that?
> 
> Johnny
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:209229
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to