<?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: Even More Experiments with Includes</title>
	<atom:link href="http://gamesfromwithin.com/even-more-experiments-with-includes/feed" rel="self" type="application/rss+xml" />
	<link>http://gamesfromwithin.com/even-more-experiments-with-includes</link>
	<description>Living the indie life</description>
	<lastBuildDate>Tue, 15 May 2012 19:19:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: murphy</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-111</link>
		<dc:creator>murphy</dc:creator>
		<pubDate>Mon, 14 Mar 2005 08:47:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-111</guid>
		<description>I just came upon this page by chance - looked interesting so read it. My first thoughts were the same as Troy&#039;s - in that surely the external guards test is not particularly fair (not even relevant) as they don&#039;t involve disk access.



I&#039;m not even sure the test was fair because you used two different OSs - shouldn&#039;t you try a win32 build of gcc against MSVC? (maybe you did and I just missed that bit). Could be Win32 file access is just crap or you had a virus checker turned on?



The only real way to test which is better is to take a large existing project and change it over to use #pragma once instead and see what the speed increases are.



Modest use of precompiled headers and internal guards are probably fine though and then you can spend your spare time writing useful code and not worrying about saving a few 10ths of a second compile time :-)</description>
		<content:encoded><![CDATA[<p>I just came upon this page by chance &#8211; looked interesting so read it. My first thoughts were the same as Troy&#8217;s &#8211; in that surely the external guards test is not particularly fair (not even relevant) as they don&#8217;t involve disk access.</p>
<p>I&#8217;m not even sure the test was fair because you used two different OSs &#8211; shouldn&#8217;t you try a win32 build of gcc against MSVC? (maybe you did and I just missed that bit). Could be Win32 file access is just crap or you had a virus checker turned on?</p>
<p>The only real way to test which is better is to take a large existing project and change it over to use #pragma once instead and see what the speed increases are.</p>
<p>Modest use of precompiled headers and internal guards are probably fine though and then you can spend your spare time writing useful code and not worrying about saving a few 10ths of a second compile time <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Troy Gilbert</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-110</link>
		<dc:creator>Troy Gilbert</dc:creator>
		<pubDate>Tue, 08 Mar 2005 21:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-110</guid>
		<description>Perhaps I&#039;m missing something, but aren&#039;t the external guards significantly faster because they preclude any disk access, whereas an internal guard or pragma require the include file to be opened first?



Additionally, I would expect pragma to be faster than the internal guards because the pragma is a first-class function of the pre-processor. When the pre-processor consumes it there is no ambiguity.



Internal guards, on the other hand, are not first-class concepts to pre-processor, they&#039;re constructs built from first-class pre-processor functionality. In other words, the pre-processor doesn&#039;t know that you&#039;re attempting to eliminate redundant header processing. More importantly, the pre-processor has no clue what to do until it has consumed the entire file. And even then, I would doubt the pre-processor (in conjunction with the compiler) is optimized for the specific case of #ifdef&#039;ing a file into emptiness. I would expect the compiler to simply receive an empty file. But, I may not be giving the compiler writers enough credit... ;)



Of course, this may all be stuff that was just being assumed by all of you guys, I am a little &quot;new&quot; to this stuff. ;)



All that being said, I am suprised that Visual Studio trailed so far behind GCC. It doesn&#039;t suprise me it trailed, just by what seemed to be several orders of magnitude for something that didn&#039;t involve any real compiling. Of course, as menteiond before, this test case is particularly pathological. Again, to not disregard the compiler writers, perhaps the Visual Studio approach solves a more common, &quot;real world&quot; problem more efficiently at the expense of this scenario?</description>
		<content:encoded><![CDATA[<p>Perhaps I&#8217;m missing something, but aren&#8217;t the external guards significantly faster because they preclude any disk access, whereas an internal guard or pragma require the include file to be opened first?</p>
<p>Additionally, I would expect pragma to be faster than the internal guards because the pragma is a first-class function of the pre-processor. When the pre-processor consumes it there is no ambiguity.</p>
<p>Internal guards, on the other hand, are not first-class concepts to pre-processor, they&#8217;re constructs built from first-class pre-processor functionality. In other words, the pre-processor doesn&#8217;t know that you&#8217;re attempting to eliminate redundant header processing. More importantly, the pre-processor has no clue what to do until it has consumed the entire file. And even then, I would doubt the pre-processor (in conjunction with the compiler) is optimized for the specific case of #ifdef&#8217;ing a file into emptiness. I would expect the compiler to simply receive an empty file. But, I may not be giving the compiler writers enough credit&#8230; <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Of course, this may all be stuff that was just being assumed by all of you guys, I am a little &#8220;new&#8221; to this stuff. <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>All that being said, I am suprised that Visual Studio trailed so far behind GCC. It doesn&#8217;t suprise me it trailed, just by what seemed to be several orders of magnitude for something that didn&#8217;t involve any real compiling. Of course, as menteiond before, this test case is particularly pathological. Again, to not disregard the compiler writers, perhaps the Visual Studio approach solves a more common, &#8220;real world&#8221; problem more efficiently at the expense of this scenario?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Llopis</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-109</link>
		<dc:creator>Noel Llopis</dc:creator>
		<pubDate>Sun, 06 Feb 2005 20:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-109</guid>
		<description>There, this should answer how I feel about Incredibuild: &lt;a href=&quot;http://www.gamesfromwithin.com/articles/0502/000069.html&quot; rel=&quot;nofollow&quot;&gt;http://www.gamesfromwithin.com/articles/0502/000069.html&lt;/a&gt; :-)</description>
		<content:encoded><![CDATA[<p>There, this should answer how I feel about Incredibuild: <a href="http://www.gamesfromwithin.com/articles/0502/000069.html" rel="nofollow">http://www.gamesfromwithin.com/articles/0502/000069.html</a> <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle Wilson</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-108</link>
		<dc:creator>Kyle Wilson</dc:creator>
		<pubDate>Sun, 06 Feb 2005 16:07:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-108</guid>
		<description>&quot;I don&#039;t think Kyle&#039;s test case is really representative of any realistic situation.&quot;



Gosh, I sure hope not.  :)</description>
		<content:encoded><![CDATA[<p>&#8220;I don&#8217;t think Kyle&#8217;s test case is really representative of any realistic situation.&#8221;</p>
<p>Gosh, I sure hope not.  <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Llopis</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-107</link>
		<dc:creator>Noel Llopis</dc:creator>
		<pubDate>Fri, 04 Feb 2005 04:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-107</guid>
		<description>&gt; Why don&#039;t you like Incredibuild?



Gosh, I started replying to that, but after I was typing for 10 minutes, I realized it would be best left as a full article. And even though I don&#039;t like to bash products, I really think that Incredibuild can be actually harmful to a project. I&#039;ll put up a full rant tomorrow :-)</description>
		<content:encoded><![CDATA[<p>> Why don&#8217;t you like Incredibuild?</p>
<p>Gosh, I started replying to that, but after I was typing for 10 minutes, I realized it would be best left as a full article. And even though I don&#8217;t like to bash products, I really think that Incredibuild can be actually harmful to a project. I&#8217;ll put up a full rant tomorrow <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: msew</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-106</link>
		<dc:creator>msew</dc:creator>
		<pubDate>Thu, 03 Feb 2005 17:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-106</guid>
		<description>&gt;On the whole, I&#039;m not very happy with Incredibuild (for many different reasons).



Why don&#039;t you like Incredibuild?



The biggest issue we had was that edit and continue is not supported.  Other than that it was a massive massive time saver.  From 30-40 minute builds down to sub 10 minutes for a complete rebuilt.



It took me about 2 hours or so to get our Unreal based codebase to work with it (with all the compiling and re compiling).  But after that start up cost it was smooth sailing.</description>
		<content:encoded><![CDATA[<p>>On the whole, I&#8217;m not very happy with Incredibuild (for many different reasons).</p>
<p>Why don&#8217;t you like Incredibuild?</p>
<p>The biggest issue we had was that edit and continue is not supported.  Other than that it was a massive massive time saver.  From 30-40 minute builds down to sub 10 minutes for a complete rebuilt.</p>
<p>It took me about 2 hours or so to get our Unreal based codebase to work with it (with all the compiling and re compiling).  But after that start up cost it was smooth sailing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: msew</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-105</link>
		<dc:creator>msew</dc:creator>
		<pubDate>Thu, 03 Feb 2005 17:15:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-105</guid>
		<description>As of incredibuild 2.12 or so #pragma once was no go.  I don&#039;t know if they fixed in in 2.20 or not.</description>
		<content:encoded><![CDATA[<p>As of incredibuild 2.12 or so #pragma once was no go.  I don&#8217;t know if they fixed in in 2.20 or not.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JasonR</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-104</link>
		<dc:creator>JasonR</dc:creator>
		<pubDate>Fri, 28 Jan 2005 22:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-104</guid>
		<description>I just tried putting external include guards on all of the most used files in the codebase I work on, including the precompiled.h inclusion in every header, and I got 0 speedup (no second change in a 45 second compile).  I use MSVC 7.1 and tested both debug and release modes.  I don&#039;t think Kyle&#039;s test case is really representative of any realistic situation.</description>
		<content:encoded><![CDATA[<p>I just tried putting external include guards on all of the most used files in the codebase I work on, including the precompiled.h inclusion in every header, and I got 0 speedup (no second change in a 45 second compile).  I use MSVC 7.1 and tested both debug and release modes.  I don&#8217;t think Kyle&#8217;s test case is really representative of any realistic situation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Llopis</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-103</link>
		<dc:creator>Noel Llopis</dc:creator>
		<pubDate>Fri, 28 Jan 2005 16:10:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-103</guid>
		<description>Good point about Incredibuild. I don&#039;t know how it will deal with #pragma once. It tends to get confused enough without it, so I would be very hesitant to rely on that. On the whole, I&#039;m not very happy with Incredibuild (for many different reasons).



distcc relies on doing a local preprocessor pass on a file, and then passing it on to the nextwork to be compiled, so I suspect the results would be the same as for the local compilation and #pragma once would work just fine.



It&#039;s true that unknown #pragma directives should be ignored, but that&#039;s not always the case. For example, older versions of gcc used to spew messages saying that #pragma was a deprecated directive. Since #pragmas are totally non-standard, it&#039;s also concievable that compilers can use the same one to mean different things (although highly unlikely with something like #pragma once).



In general, if you plan to compile your code in more than one compiler (a good thing even if you&#039;re only developing for one platform), it&#039;s a good idea to #ifdef the pragma directives so they only apply to the compilers you intended them for.</description>
		<content:encoded><![CDATA[<p>Good point about Incredibuild. I don&#8217;t know how it will deal with #pragma once. It tends to get confused enough without it, so I would be very hesitant to rely on that. On the whole, I&#8217;m not very happy with Incredibuild (for many different reasons).</p>
<p>distcc relies on doing a local preprocessor pass on a file, and then passing it on to the nextwork to be compiled, so I suspect the results would be the same as for the local compilation and #pragma once would work just fine.</p>
<p>It&#8217;s true that unknown #pragma directives should be ignored, but that&#8217;s not always the case. For example, older versions of gcc used to spew messages saying that #pragma was a deprecated directive. Since #pragmas are totally non-standard, it&#8217;s also concievable that compilers can use the same one to mean different things (although highly unlikely with something like #pragma once).</p>
<p>In general, if you plan to compile your code in more than one compiler (a good thing even if you&#8217;re only developing for one platform), it&#8217;s a good idea to #ifdef the pragma directives so they only apply to the compilers you intended them for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Parveen Kaler</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-102</link>
		<dc:creator>Parveen Kaler</dc:creator>
		<pubDate>Fri, 28 Jan 2005 05:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-102</guid>
		<description>Some things to consider about pragma directives.  &quot;#pragma once&quot; did not used to work well with IncrediBuild in the past.  I&#039;m not sure if that is still the case.  Haven&#039;t tried with distcc.



The holy standard (ISO 14882 - 1998) in section 16.6/1 states:



&quot;A preprocessing directive of the form



#pragma pp-token new-line



causes the implementation to behave in an implementation-defined manner.  Any pragma that is not recognized by the implementation is ignored.&quot;</description>
		<content:encoded><![CDATA[<p>Some things to consider about pragma directives.  &#8220;#pragma once&#8221; did not used to work well with IncrediBuild in the past.  I&#8217;m not sure if that is still the case.  Haven&#8217;t tried with distcc.</p>
<p>The holy standard (ISO 14882 &#8211; 1998) in section 16.6/1 states:</p>
<p>&#8220;A preprocessing directive of the form</p>
<p>#pragma pp-token new-line</p>
<p>causes the implementation to behave in an implementation-defined manner.  Any pragma that is not recognized by the implementation is ignored.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: msew</title>
		<link>http://gamesfromwithin.com/even-more-experiments-with-includes/comment-page-1#comment-101</link>
		<dc:creator>msew</dc:creator>
		<pubDate>Thu, 27 Jan 2005 04:30:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=322#comment-101</guid>
		<description>ahh good stuff  I was getting a little worried that I would have to go back to using lakos style external include guards.</description>
		<content:encoded><![CDATA[<p>ahh good stuff  I was getting a little worried that I would have to go back to using lakos style external include guards.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

