Reply to topic
Coding Tip: Evaluate Function
JeanR
HostMySite Marketing

Joined: 28 Feb 2005
Posts: 86
Reply with quote
When looking to improve the performance of your code, you may want to examine your use of the ColdFusion Evaluate function. The ColdFusion Evaluate function is often used to resolve dynamically named variables, such as form variables. This function forces ColdFusion to compile every time you call the expression, which results in increased process time and memory usage within a shared ColdFusion environment. Since deploying our self-healing solution within the shared environment, we've noticed quite a few websites that could benefit from avoiding the Evaluate function whenever possible.

While most instances of the Evaluate function look similar to:

Code:
<cfset value=evaluate("form.field#i#")>


You can consider writing something such as:

Code:
<cfset value=form["field#i#"]>


For more information on avoiding the Evaluate function, see the Adobe Livedocs article which can be found at http://livedocs.macromedia.com
Coding Tip: Evaluate Function
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic