<?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: What&#8217;s Your Pain Threshold?</title>
	<atom:link href="http://gamesfromwithin.com/whats-your-pain-threshold/feed" rel="self" type="application/rss+xml" />
	<link>http://gamesfromwithin.com/whats-your-pain-threshold</link>
	<description>Living the indie life</description>
	<lastBuildDate>Thu, 17 May 2012 17:38: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: Noel</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-695</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Wed, 24 Dec 2008 20:10:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-695</guid>
		<description>If you&#039;re using quite a lot of STL and Boost, that&#039;s your answer for long compile and link times :-( I&#039;m not sure what you can do about it other than try to minimize their use and how far in your code they extend (which can be difficult once they&#039;re in), and to keep them away from new code you write, preferably in a separate library.

Personally, I haven&#039;t found STL or Boost to be useful for game runtime in a console environment. On a PC I might consider it, but I would probably choose not to because of their effect on build times like you&#039;re experiencing.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re using quite a lot of STL and Boost, that&#8217;s your answer for long compile and link times <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' />  I&#8217;m not sure what you can do about it other than try to minimize their use and how far in your code they extend (which can be difficult once they&#8217;re in), and to keep them away from new code you write, preferably in a separate library.</p>
<p>Personally, I haven&#8217;t found STL or Boost to be useful for game runtime in a console environment. On a PC I might consider it, but I would probably choose not to because of their effect on build times like you&#8217;re experiencing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ash McConnell</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-693</link>
		<dc:creator>Ash McConnell</dc:creator>
		<pubDate>Wed, 24 Dec 2008 13:29:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-693</guid>
		<description>Hi Noel,

Thanks for the quick reply - I found the article soon after my post - sorry I should have done a more extensive search!

I tried to get the analysis perl script working, but came across a few problems, perlmod seems to get confused easily (much like myself :) ) I had a number of unmatched brackets errors, I did get it running against a particular project, but it reported a lot of useless headers which were actually quite useful (essential to compile) :).

I&#039;m not sure what I am doing wrong, but I&#039;ll hopefully have a chance to look at it after Christmas.  I havent used doxygen before - i was creating the doxyfile using the win32 wizard thingy.

I am using quite a lot of STL and Boost, I am also using Ogre.

I&#039;ll have to have a major look at ways to reduce it, it can&#039;t continue at this speed, I am getting distracted when I am compiling as you mention in the article, it makes it really hard to keep the flow.

Thanks again!
All the best,
Ash</description>
		<content:encoded><![CDATA[<p>Hi Noel,</p>
<p>Thanks for the quick reply &#8211; I found the article soon after my post &#8211; sorry I should have done a more extensive search!</p>
<p>I tried to get the analysis perl script working, but came across a few problems, perlmod seems to get confused easily (much like myself <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) I had a number of unmatched brackets errors, I did get it running against a particular project, but it reported a lot of useless headers which were actually quite useful (essential to compile) <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>I&#8217;m not sure what I am doing wrong, but I&#8217;ll hopefully have a chance to look at it after Christmas.  I havent used doxygen before &#8211; i was creating the doxyfile using the win32 wizard thingy.</p>
<p>I am using quite a lot of STL and Boost, I am also using Ogre.</p>
<p>I&#8217;ll have to have a major look at ways to reduce it, it can&#8217;t continue at this speed, I am getting distracted when I am compiling as you mention in the article, it makes it really hard to keep the flow.</p>
<p>Thanks again!<br />
All the best,<br />
Ash</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-688</link>
		<dc:creator>Noel</dc:creator>
		<pubDate>Tue, 23 Dec 2008 20:28:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-688</guid>
		<description>Hi Ash,

My best advice on compile times is in this article: http://gamesfromwithin.com/?p=8

Basically it comes down to:
- Use include guards
- Make the first include of each cpp file its corresponding .h file
- Keep what you have in a header file to a minimum (forward declare instead of include, etc)
- Keep your logical dependencies to a minimum (don&#039;t include windows.h unless you absolutely have to for example).

Precompiled headers can be OK, but I&#039;m not a huge fan of them. Maybe for some really heavy headers like windows or Havok if you use them in most of your code.

The times you&#039;re quoting sound pretty high. Are you using STL? That&#039;s a time sink for sure!</description>
		<content:encoded><![CDATA[<p>Hi Ash,</p>
<p>My best advice on compile times is in this article: <a href="http://gamesfromwithin.com/?p=8" rel="nofollow">http://gamesfromwithin.com/?p=8</a></p>
<p>Basically it comes down to:<br />
- Use include guards<br />
- Make the first include of each cpp file its corresponding .h file<br />
- Keep what you have in a header file to a minimum (forward declare instead of include, etc)<br />
- Keep your logical dependencies to a minimum (don&#8217;t include windows.h unless you absolutely have to for example).</p>
<p>Precompiled headers can be OK, but I&#8217;m not a huge fan of them. Maybe for some really heavy headers like windows or Havok if you use them in most of your code.</p>
<p>The times you&#8217;re quoting sound pretty high. Are you using STL? That&#8217;s a time sink for sure!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ash McConnell</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-687</link>
		<dc:creator>Ash McConnell</dc:creator>
		<pubDate>Tue, 23 Dec 2008 18:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-687</guid>
		<description>Hi Noel,

For my game I have currently around 60000 lines including some tests, My build time for just modifying a single .cpp is around 30 secs.  Around 5 seconds for the library in question, 10-15 to link the test runner and 10-15 for the game to link.

It is getting to be very frustrating - 2 secs would be a dream :).  I am using CxxTest and Visual Studio 2005 on a Q6600 Quadcore with 3 gig of ram and a reasonably fast HD - I am also using Precompiled headers.  

Do you have any general tips on getting the compile time down?  I&#039;ve always had the feeling that it was slow, but I now realise its massively slow!

Thanks for your help
All the best,
Ash</description>
		<content:encoded><![CDATA[<p>Hi Noel,</p>
<p>For my game I have currently around 60000 lines including some tests, My build time for just modifying a single .cpp is around 30 secs.  Around 5 seconds for the library in question, 10-15 to link the test runner and 10-15 for the game to link.</p>
<p>It is getting to be very frustrating &#8211; 2 secs would be a dream <img src='http://gamesfromwithin.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  I am using CxxTest and Visual Studio 2005 on a Q6600 Quadcore with 3 gig of ram and a reasonably fast HD &#8211; I am also using Precompiled headers.  </p>
<p>Do you have any general tips on getting the compile time down?  I&#8217;ve always had the feeling that it was slow, but I now realise its massively slow!</p>
<p>Thanks for your help<br />
All the best,<br />
Ash</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddie</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-462</link>
		<dc:creator>Eddie</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-462</guid>
		<description>Hi Noel,

as you wrote in your article that you got a performance improvment by not initilizing the memory.

&quot;Even though the constructor was simply initializing its members to zero, that was causing a significant slow down when so many objects were created.&quot;

That is the way that I learned my whole life to initialize the member variables by a class and even a struct. What is Lint saying about this?

Regards,
Eddie</description>
		<content:encoded><![CDATA[<p>Hi Noel,</p>
<p>as you wrote in your article that you got a performance improvment by not initilizing the memory.</p>
<p>&#8220;Even though the constructor was simply initializing its members to zero, that was causing a significant slow down when so many objects were created.&#8221;</p>
<p>That is the way that I learned my whole life to initialize the member variables by a class and even a struct. What is Lint saying about this?</p>
<p>Regards,<br />
Eddie</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-463</link>
		<dc:creator>Ian</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-463</guid>
		<description>I&#039;m curious as to what your project organization looks like, specifically when dealing with unit tests.  It seems like the most straightforward thing to do would be to have a separate unit test executable for each library so unit tests are only run when the library changes.  I noticed though that it looks like you can just run your executable with a -unittest switch and it runs every single test (which would be especially useful for testing on a console).  Also, if you didn&#039;t have unit tests baked into the executable then you couldn&#039;t run tests on any code in the main executable (though you could get around that pretty easily by having the executable be a simple wrapper around a library).  Can you shine any light on this?</description>
		<content:encoded><![CDATA[<p>I&#8217;m curious as to what your project organization looks like, specifically when dealing with unit tests.  It seems like the most straightforward thing to do would be to have a separate unit test executable for each library so unit tests are only run when the library changes.  I noticed though that it looks like you can just run your executable with a -unittest switch and it runs every single test (which would be especially useful for testing on a console).  Also, if you didn&#8217;t have unit tests baked into the executable then you couldn&#8217;t run tests on any code in the main executable (though you could get around that pretty easily by having the executable be a simple wrapper around a library).  Can you shine any light on this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JC</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-464</link>
		<dc:creator>JC</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-464</guid>
		<description>I&#039;d love to have compile times as low as that - link times here can be in the region of minutes which really breaks up flow.

It&#039;s interesting that you only initialise Havok once for all tests - are you not worried about potential side effects between different tests being run? I&#039;ve had numerous problems with tests giving incorrect results because a previous test has gone haywire in some way. Theres nothing worse than people complaining that your test is failing only to discover that it&#039;s actually fine but someone else&#039;s test is corrupting memory beforehand. Have you avoided any problems like this so far?

I now spawn a new process for each test so that they can&#039;t interfere, but this adds about half a second to every test (for an 18Mb executable). This isn&#039;t as bad as it seems really, since usually I&#039;m only running a tiny subset, and there&#039;s a command line option to run in a single process for when you want to run everything quickly (which takes about a second for my ~150 tests).</description>
		<content:encoded><![CDATA[<p>I&#8217;d love to have compile times as low as that &#8211; link times here can be in the region of minutes which really breaks up flow.</p>
<p>It&#8217;s interesting that you only initialise Havok once for all tests &#8211; are you not worried about potential side effects between different tests being run? I&#8217;ve had numerous problems with tests giving incorrect results because a previous test has gone haywire in some way. Theres nothing worse than people complaining that your test is failing only to discover that it&#8217;s actually fine but someone else&#8217;s test is corrupting memory beforehand. Have you avoided any problems like this so far?</p>
<p>I now spawn a new process for each test so that they can&#8217;t interfere, but this adds about half a second to every test (for an 18Mb executable). This isn&#8217;t as bad as it seems really, since usually I&#8217;m only running a tiny subset, and there&#8217;s a command line option to run in a single process for when you want to run everything quickly (which takes about a second for my ~150 tests).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: noel</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-465</link>
		<dc:creator>noel</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-465</guid>
		<description>&lt;p&gt;I agree that ideally Havok should be completely shutdown and restarted for every test so there&#039;s no chance of tests interfering with each other. Unfortunately that was causing a &quot;signficant&quot; slowdown for us. It seems that Havok is well behaved and we&#039;ve had no problems at all with that. Kepp in mind that we&#039;re creating/destroying the Havok world with each test, so it&#039;s just the Havok system (and its memory manager and whatever other global state it has) that stays around. So far so good...&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I agree that ideally Havok should be completely shutdown and restarted for every test so there&#8217;s no chance of tests interfering with each other. Unfortunately that was causing a &quot;signficant&quot; slowdown for us. It seems that Havok is well behaved and we&#8217;ve had no problems at all with that. Kepp in mind that we&#8217;re creating/destroying the Havok world with each test, so it&#8217;s just the Havok system (and its memory manager and whatever other global state it has) that stays around. So far so good&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MagnusC</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-#comment-466</link>
		<dc:creator>MagnusC</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-466</guid>
		<description>A complete build in 50 secs, that sounds nice! In my company we actually started to focus a little on maintenance on the actual build system a while ago. Going from a complete all-platform build of nine hours to a whopping three hours! BTW, thanks for the inspiration, I got my TDD running quite smoothly now.</description>
		<content:encoded><![CDATA[<p>A complete build in 50 secs, that sounds nice! In my company we actually started to focus a little on maintenance on the actual build system a while ago. Going from a complete all-platform build of nine hours to a whopping three hours! BTW, thanks for the inspiration, I got my TDD running quite smoothly now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Slava Tutushkin</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-467</link>
		<dc:creator>Slava Tutushkin</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-467</guid>
		<description>Hi, Noel.

Could you please tell me, what mocking framework are you using? mockpp? Or something else? Are you doing mocking at all?</description>
		<content:encoded><![CDATA[<p>Hi, Noel.</p>
<p>Could you please tell me, what mocking framework are you using? mockpp? Or something else? Are you doing mocking at all?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Codignotto</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-468</link>
		<dc:creator>Nick Codignotto</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-468</guid>
		<description>Someone over here read this and reminded be about the xkcd comic #303:

http://xkcd.com/303/</description>
		<content:encoded><![CDATA[<p>Someone over here read this and reminded be about the xkcd comic #303:</p>
<p><a href="http://xkcd.com/303/" rel="nofollow">http://xkcd.com/303/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: noel</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-469</link>
		<dc:creator>noel</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-469</guid>
		<description>&lt;p&gt;I&#039;m not a fan of mocks at all. But when we do it, we write them by hand. A simple interface should make for a very simple mock so that&#039;s not a big deal. I find that the less you need mocks, the better the code is (more simple data passing and less inter-object communication).&lt;/p&gt;
&lt;p&gt;Having said that, I&#039;m starting to look for a better solution. I&#039;d like a mock framework (or something) not so much to avoid writing the mock, but to avoid having to change the architecture. Right now when we mock a class, we need to create an interface, whether one was needed or not. Even worse, when we mock a static, non-member function, we need to do all sorts of weird things (either make it a class, or create a function pointer somewhere, or something).&lt;/p&gt;
&lt;p&gt;Even though I usually favor really, really simple solutions, our friend &lt;a href=&quot;http://www.rorydriscoll.com/&quot;&gt;Rory Driscoll&lt;/a&gt; has started writing about his mocking framework, &lt;a href=&quot;http://code.google.com/p/mockitnow/&quot;&gt;MockItNow&lt;/a&gt;, so that&#039;s something I&#039;d like to check out soon.&lt;/p&gt;
&lt;p&gt;&#160;&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>I&#8217;m not a fan of mocks at all. But when we do it, we write them by hand. A simple interface should make for a very simple mock so that&#8217;s not a big deal. I find that the less you need mocks, the better the code is (more simple data passing and less inter-object communication).</p>
<p>Having said that, I&#8217;m starting to look for a better solution. I&#8217;d like a mock framework (or something) not so much to avoid writing the mock, but to avoid having to change the architecture. Right now when we mock a class, we need to create an interface, whether one was needed or not. Even worse, when we mock a static, non-member function, we need to do all sorts of weird things (either make it a class, or create a function pointer somewhere, or something).</p>
<p>Even though I usually favor really, really simple solutions, our friend <a href="http://www.rorydriscoll.com/">Rory Driscoll</a> has started writing about his mocking framework, <a href="http://code.google.com/p/mockitnow/">MockItNow</a>, so that&#8217;s something I&#8217;d like to check out soon.</p>
<p>&nbsp;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Legge</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-470</link>
		<dc:creator>Brian Legge</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-470</guid>
		<description>Roughly how many lines of code do you have? How big are your executables?

With a runtime that is roughly a million lines of code that generates a 20 meg executable (significantly larger with symbols), our link times alone are closer to 5 minutes. I&#039;d love to get that pulled down, but I don&#039;t know what a reasonable minimum is to target given our scale.

Sadly, incremental builds haven&#039;t worked for us in a long time. I don&#039;t recall the cause - I think it had something to do with all of our iteration code existing in libraries.</description>
		<content:encoded><![CDATA[<p>Roughly how many lines of code do you have? How big are your executables?</p>
<p>With a runtime that is roughly a million lines of code that generates a 20 meg executable (significantly larger with symbols), our link times alone are closer to 5 minutes. I&#8217;d love to get that pulled down, but I don&#8217;t know what a reasonable minimum is to target given our scale.</p>
<p>Sadly, incremental builds haven&#8217;t worked for us in a long time. I don&#8217;t recall the cause &#8211; I think it had something to do with all of our iteration code existing in libraries.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: noel</title>
		<link>http://gamesfromwithin.com/whats-your-pain-threshold/comment-page-1#comment-471</link>
		<dc:creator>noel</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gamesfromwithin.dreamhosters.com/?p=446#comment-471</guid>
		<description>&lt;p&gt;Our codebase is much, much smaller. We&#039;re just two guys banging on the code for a year at the same time we try to do everything else (getting the company off the ground, design, art direction, contracting, etc, etc). We also value simplicity and small code base above many other things.&lt;/p&gt;
&lt;p&gt;Lots of people have been asking about it, so I was planning on writing a followup post to this one with the exact code size, number of tests, C vs. C#, and all that fun stuff.&lt;/p&gt;
&lt;p&gt;On the other hand I have to ask... one million lines of code???? That sounds enormous, even for a full-blown retail game. Is that for FEAR? What&#039;s the breakdown between libraries and game code? Does that include script code?&lt;/p&gt;
&lt;p&gt;Anyway, I&#039;ll try to write that other post tonight and that might spark some discussions and people sharing their code sizes.&lt;/p&gt;</description>
		<content:encoded><![CDATA[<p>Our codebase is much, much smaller. We&#8217;re just two guys banging on the code for a year at the same time we try to do everything else (getting the company off the ground, design, art direction, contracting, etc, etc). We also value simplicity and small code base above many other things.</p>
<p>Lots of people have been asking about it, so I was planning on writing a followup post to this one with the exact code size, number of tests, C vs. C#, and all that fun stuff.</p>
<p>On the other hand I have to ask&#8230; one million lines of code???? That sounds enormous, even for a full-blown retail game. Is that for FEAR? What&#8217;s the breakdown between libraries and game code? Does that include script code?</p>
<p>Anyway, I&#8217;ll try to write that other post tonight and that might spark some discussions and people sharing their code sizes.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

