Extending ColdFusion Components And Its Impact On Page Performance

<!--- Set the test size. --->
<cfset intSize = 1000 />
 
<!--- Create an array for the girls. --->
<cfset arrGirls = ArrayNew( 1 ) />
 
<!--- Resize the array. --->
<cfset ArrayResize( arrGirls, intSize ) />
 
 
<!---
	Test the performance of components that
	extend other components.
--->
<cftimer label="Extend Methodology" type="outline">
 
	<!--- Loop over the size and add a girl. --->
	<cfloop index="intIndex" from="1" to="#intSize#" step="1">
 
		<cfset arrGirls[ intIndex ] = CreateObject(
			"component",
			"Girl"
			).Init(
				FirstName = "Yuu",
				LastName = "Sekine"
			) />
 
	</cfloop>
 
</cftimer>
 
 
<!---
	Test the performance of the a GOD component that
	doesn't need to extend anything.
--->
<cftimer label="God Object Methodology" type="outline">
 
	<!--- Loop over the size and add a girl. --->
	<cfloop index="intIndex" from="1" to="#intSize#" step="1">
 
		<cfset arrGirls[ intIndex ] = CreateObject(
			"component",
			"FullGirl"
			).Init(
				FirstName = "Yuu",
				LastName = "Sekine"
			) />
 
	</cfloop>
 
</cftimer>

For Cut-and-Paste