<?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: Object-Oriented Thinking Part Two</title>
	<atom:link href="http://beej.us/blog/2010/01/object-oriented-thinking-part-two/feed/" rel="self" type="application/rss+xml" />
	<link>http://beej.us/blog/2010/01/object-oriented-thinking-part-two/</link>
	<description>Tech and Programming Fun</description>
	<lastBuildDate>Tue, 07 Feb 2012 18:52:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: beej</title>
		<link>http://beej.us/blog/2010/01/object-oriented-thinking-part-two/comment-page-1/#comment-152</link>
		<dc:creator>beej</dc:creator>
		<pubDate>Tue, 02 Feb 2010 21:12:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.beej.us/blog/?p=116#comment-152</guid>
		<description>&lt;a href=&quot;#comment-151&quot; rel=&quot;nofollow&quot;&gt;@Xerion&lt;/a&gt; Yes, there certainly is a loss, since it&#039;s an indirect jump rather than a direct one.  (That is, you need to look up in a table which function to jump to, because the instance might actually be a derived class that has overridden one of the base class&#039;s methods.)

Even though a memory lookup (and possible cache miss) is something to consider, in this modern day of really fast machines, it&#039;s less and less of a practical issue, and most people just ignore it.  (I mean, if you&#039;re running Java, you&#039;re already not at your peak efficiency compared to, say, assembly language, and that&#039;s okay!)

But if utmost speed is of the essence in some inner loop or something, you might not want to call a virtual function.</description>
		<content:encoded><![CDATA[<p><a href="#comment-151" rel="nofollow">@Xerion</a> Yes, there certainly is a loss, since it&#8217;s an indirect jump rather than a direct one.  (That is, you need to look up in a table which function to jump to, because the instance might actually be a derived class that has overridden one of the base class&#8217;s methods.)</p>
<p>Even though a memory lookup (and possible cache miss) is something to consider, in this modern day of really fast machines, it&#8217;s less and less of a practical issue, and most people just ignore it.  (I mean, if you&#8217;re running Java, you&#8217;re already not at your peak efficiency compared to, say, assembly language, and that&#8217;s okay!)</p>
<p>But if utmost speed is of the essence in some inner loop or something, you might not want to call a virtual function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Xerion</title>
		<link>http://beej.us/blog/2010/01/object-oriented-thinking-part-two/comment-page-1/#comment-151</link>
		<dc:creator>Xerion</dc:creator>
		<pubDate>Tue, 02 Feb 2010 20:57:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.beej.us/blog/?p=116#comment-151</guid>
		<description>Since my enlightenment to OOP I&#039;ve used inheritance a great deal in my projects. One thing that I heard somewhere, was that there is a performance loss for using virtual functions. Have any thoughts about this?</description>
		<content:encoded><![CDATA[<p>Since my enlightenment to OOP I&#8217;ve used inheritance a great deal in my projects. One thing that I heard somewhere, was that there is a performance loss for using virtual functions. Have any thoughts about this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Beej&#39;s Bit Bucket &#187; Object-Oriented Thinking, Part One</title>
		<link>http://beej.us/blog/2010/01/object-oriented-thinking-part-two/comment-page-1/#comment-87</link>
		<dc:creator>Beej&#39;s Bit Bucket &#187; Object-Oriented Thinking, Part One</dc:creator>
		<pubDate>Fri, 22 Jan 2010 21:42:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.beej.us/blog/?p=116#comment-87</guid>
		<description>[...] (This is continued in Object-Oriented Thinking Part Two.) [...]</description>
		<content:encoded><![CDATA[<p>[...] (This is continued in Object-Oriented Thinking Part Two.) [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

