<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: ColdFusion Performance V &#8211; The Inheritance Tax</title>
	<atom:link href="http://www.harelmalka.com/?feed=rss2&#038;p=72" rel="self" type="application/rss+xml" />
	<link>http://www.harelmalka.com/?p=72</link>
	<description>.oOo. Its a dot's world .oOo.</description>
	<lastBuildDate>Fri, 20 Aug 2010 12:42:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: harel</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1366</link>
		<dc:creator>harel</dc:creator>
		<pubDate>Sun, 08 Apr 2007 23:25:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1366</guid>
		<description>Michael, 
I think my point was missed here. I use extension all the time, in the same scenario you describe. It&#039;s a good and useful tool as is composition. My test was regarding 3 levels extensions. Where you have an object that extends another, and that one extends yet another. I would have expected, in an ideal world, that the compiled object will not bring with it 3 object instantiation penalty with it, but it does. (I&#039;ve added the 2 level extension to the test as an after thought but my original one involved no extension vs 3 level one).</description>
		<content:encoded><![CDATA[<p>Michael,<br />
I think my point was missed here. I use extension all the time, in the same scenario you describe. It&#8217;s a good and useful tool as is composition. My test was regarding 3 levels extensions. Where you have an object that extends another, and that one extends yet another. I would have expected, in an ideal world, that the compiled object will not bring with it 3 object instantiation penalty with it, but it does. (I&#8217;ve added the 2 level extension to the test as an after thought but my original one involved no extension vs 3 level one).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Long</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1343</link>
		<dc:creator>Michael Long</dc:creator>
		<pubDate>Sun, 08 Apr 2007 02:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1343</guid>
		<description>Doing my own tests on the matter, I found that with trusted cache turned on the difference in performance was about 5% per step, or more of a &quot;sales tax&quot; than an inheritence tax.

Given that, it really comes down to the question of whether or not inheritence makes sense for your application. For example, in the Datum ORM system, each business object is actually two objects, one a &quot;hidden&quot; object that contains all of the auto-generated &quot;scaffolding&quot;, and the &quot;visible&quot; object which is inherited from that, and which lets the developer override any of the auto-generated functions.

While there&#039;s a small performance hit involved in this pattern, it&#039;s balanced out in two ways:

1) It&#039;s flexible, allowing the developer a great deal of control while still allowing the auto-generated code to be rebuilt and extended whenever there&#039;s a configuration file change.

2) It minimizes object creation and parameter passing. 

While composition of objects may seem like a better arrangement, you in fact have to create that second object. Do the loop test, and you&#039;ll see that creating two objects takes twice as long as creating one. Who&#039;d have thought?

Not only that, but if the first object is a facade for the second, you&#039;re going to spending a semi-significant amount of time passing parameters and results between objects, (which your empty object tests didn&#039;t account for) again eating into your theoretical performance gain. 

In short, you&#039;re better off structuring your application in ways that make sense. Inheritence is a tool. Composition is a tool.

Just choose your tools wisely.</description>
		<content:encoded><![CDATA[<p>Doing my own tests on the matter, I found that with trusted cache turned on the difference in performance was about 5% per step, or more of a &#8220;sales tax&#8221; than an inheritence tax.</p>
<p>Given that, it really comes down to the question of whether or not inheritence makes sense for your application. For example, in the Datum ORM system, each business object is actually two objects, one a &#8220;hidden&#8221; object that contains all of the auto-generated &#8220;scaffolding&#8221;, and the &#8220;visible&#8221; object which is inherited from that, and which lets the developer override any of the auto-generated functions.</p>
<p>While there&#8217;s a small performance hit involved in this pattern, it&#8217;s balanced out in two ways:</p>
<p>1) It&#8217;s flexible, allowing the developer a great deal of control while still allowing the auto-generated code to be rebuilt and extended whenever there&#8217;s a configuration file change.</p>
<p>2) It minimizes object creation and parameter passing. </p>
<p>While composition of objects may seem like a better arrangement, you in fact have to create that second object. Do the loop test, and you&#8217;ll see that creating two objects takes twice as long as creating one. Who&#8217;d have thought?</p>
<p>Not only that, but if the first object is a facade for the second, you&#8217;re going to spending a semi-significant amount of time passing parameters and results between objects, (which your empty object tests didn&#8217;t account for) again eating into your theoretical performance gain. </p>
<p>In short, you&#8217;re better off structuring your application in ways that make sense. Inheritence is a tool. Composition is a tool.</p>
<p>Just choose your tools wisely.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harel</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1342</link>
		<dc:creator>harel</dc:creator>
		<pubDate>Sat, 07 Apr 2007 23:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1342</guid>
		<description>Douglas, 
Couple more things: Yes passing as argument wasn&#039;t said describing composition - it was merely another way of &#039;doing it&#039;. 
And, in some cases you can cache an object which is a property of another, saving on instantiation.</description>
		<content:encoded><![CDATA[<p>Douglas,<br />
Couple more things: Yes passing as argument wasn&#8217;t said describing composition &#8211; it was merely another way of &#8216;doing it&#8217;.<br />
And, in some cases you can cache an object which is a property of another, saving on instantiation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harel</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1341</link>
		<dc:creator>harel</dc:creator>
		<pubDate>Sat, 07 Apr 2007 21:26:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1341</guid>
		<description>Michael, sorry - with trusted on or without, the 3 level inheritance takes a heavy toll....</description>
		<content:encoded><![CDATA[<p>Michael, sorry &#8211; with trusted on or without, the 3 level inheritance takes a heavy toll&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harel</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1340</link>
		<dc:creator>harel</dc:creator>
		<pubDate>Sat, 07 Apr 2007 21:20:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1340</guid>
		<description>Douglas, 
Remember that a busy site might bet more than 10K requests in a day, and some might get that in an hour. It all ads up and make up how many pages a single server can serve up.
Harel</description>
		<content:encoded><![CDATA[<p>Douglas,<br />
Remember that a busy site might bet more than 10K requests in a day, and some might get that in an hour. It all ads up and make up how many pages a single server can serve up.<br />
Harel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Douglas Knudsen</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1337</link>
		<dc:creator>Douglas Knudsen</dc:creator>
		<pubDate>Sat, 07 Apr 2007 03:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1337</guid>
		<description>ugh, regardless of OO practice, 10k cfcs is way above the norm eh?  CFC instantiation is expensive whether composition or inheritance is in use.  Passing a object to a method of another object is not really composition, eh? Composition is the &#039;has a&#039; relation ship, A has a B so A is composed of properties and a B.  Two cfcs are still created, so at 10k iterations, still very expensive.  

DK</description>
		<content:encoded><![CDATA[<p>ugh, regardless of OO practice, 10k cfcs is way above the norm eh?  CFC instantiation is expensive whether composition or inheritance is in use.  Passing a object to a method of another object is not really composition, eh? Composition is the &#8216;has a&#8217; relation ship, A has a B so A is composed of properties and a B.  Two cfcs are still created, so at 10k iterations, still very expensive.  </p>
<p>DK</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Long</title>
		<link>http://www.harelmalka.com/?p=72&#038;cpage=1#comment-1334</link>
		<dc:creator>Michael Long</dc:creator>
		<pubDate>Fri, 06 Apr 2007 01:34:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.harelmalka.com/?p=72#comment-1334</guid>
		<description>Now go back and run the tests again, but this time turn on &quot;Trusted Cache&quot; in CFAdministrator.</description>
		<content:encoded><![CDATA[<p>Now go back and run the tests again, but this time turn on &#8220;Trusted Cache&#8221; in CFAdministrator.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
