Performance wise you'd probably only see a difference in the milliseconds.

Memory wise you might see a difference in the last one because of the extra
variable storage, but only on sites with really high traffic.

That's my guess that is.


andy

-----Original Message-----
From: Chuck Weidler [mailto:h...@coldfusionguru.com] 
Sent: Saturday, May 08, 2010 8:50 PM
To: cf-talk
Subject: Which is more efficient?


I was set here on a Saturday morning writing code for a website and I was
wondering what is more efficient when working with setting and manipulating
variable values.

Which is more efficient?

Doing it all in one call?
<cfscript>
Variables.myVar = Trim(Replace(SomeValue, "whatever", "something", "ALL"));
</cfscript>

Seperating the functions?
<cfscript>
Variables.myVar = Replace(SomeValue, "whatever", "something", "ALL");
Variables.myVar = Trim(Variables.myVar);
</cfscript>

Seperating the functions with a assignment to a new variable?
<cfscript>
Variables.myVar = Replace(SomeValue, "whatever", "something", "ALL");
Variables.myNewVar = Trim(Variables.myVar);
</cfscript>

Like I said just something I was thinking about.

Chuck 




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333534
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to