Testing ColdFusion Custom Tag Processing Overhead

<!---
	Set the number of variables we are going to be paraming
	in our speed tests.
--->
<cfset intCount = 500 />
 
 
<!---
	For our first run, we are going to use a ColdFusion custom
	tag to param a variable. If the internal CFParam tag fails,
	then the custom tag will take care of setting the default.
	We are doing this to see what kind of overhead the custom
	cfparaming tag adds to processing.
--->
<cftimer
	type="outline"
	label="ColdFusion Custom Tag">
 
	<!--- Loop over a number of variables to param. --->
	<cfloop
		index="intI"
		from="1"
		to="#intCount#"
		step="1">
 
		<!---
			Set a variable value that we know will fail the
			following CFParam tag.
		--->
		<cfset FORM[ "varA#intI#" ] = "" />
 
 
		<!--- Param the value using ColdFusion custom tag. --->
		<cf_param
			name="FORM.varA#intI#"
			type="numeric"
			default="0"
			/>
 
 
		#FORM[ "varA#intI#" ]#
 
	</cfloop>
 
</cftimer>
 
 
<!---
	Now, we are going to param a bunch of variables in exactly
	the same way that the first timer did; only, this time, we
	are going to do the try / catch inline so that no custom
	tag is needed.
--->
<cftimer
	type="outline"
	label="Inline CFTry / CFCatch">
 
	<!--- Loop over a number of variables to param. --->
	<cfloop
		index="intI"
		from="1"
		to="#intCount#"
		step="1">
 
		<!---
			Set a variable value that we know will fail the
			following CFParam tag.
		--->
		<cfset FORM[ "varB#intI#" ] = "" />
 
 
		<!--- Param the value using CFTry / CFCatch. --->
		<cftry>
			<cfparam
				name="FORM.varB#intI#"
				type="numeric"
				default="1"
				/>
 
			<!---
				Catch the paraming value and then set the
				variable to be the same as the default.
			--->
			<cfcatch>
				<cfset FORM[ "varB#intI#" ] = 1 />
			</cfcatch>
		</cftry>
 
 
		#FORM[ "varB#intI#" ]#
 
	</cfloop>
 
</cftimer>

For Cut-and-Paste