Measuring Performance


This chapter suggests a number of techniques to improve application performance, and you will come across others while learning about ColdFusion. How can you tell whether they are helping in your application? As you'll read in the following subsections, a number of ColdFusion tools are available to help with this task.

Execution Time

In ColdFusion Administrator, you can select the Report Execution Times checkbox under Debugging. This option displays the total time of page processing and execution. By recording a page's execution times, you could see whether changes to the page help improve performance.

<cftimer>

To determine the execution time of specific lines of code, wrap that code within <cftimer> tags. Results will be displayed in the debug output (default), inline, in HTML comments, or in generated page outlines (depending on the type specified):

 <cftimer label="some label" type="outline">  Code to time </cftimer> 

GetTickCount()

<cftimer> leverages a function named GetTickCount() internally, and this function may be used directly too:

 <cfset Start=GetTickCount()>  Code to time <cfset End=GetTickCount()> <cfoutput>The time to process is: #End-Start#</cfoutput> 



Macromedia ColdFusion MX 7 Certified Developer Study Guide
Macromedia ColdFusion MX 7 Certified Developer Study Guide
ISBN: 0321330110
EAN: 2147483647
Year: 2004
Pages: 389
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net