Jump to content


How long does it take to compile your game from scratch?


19 replies to this topic

#1 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 28 September 2007 - 12:32 AM

Posted Image

Tr8 currently takes about an hour for the Xbox360 build on my (ok, pretty old) P4 3.2 GHz (with hyperthreading, yay! :dry:). The other platforms are about 25% faster, though.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#2 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 28 September 2007 - 06:01 AM

I worked on "Infamous" (from Sucker Punch Productions) over the summer, and IIRC it would take about 20-30 minutes to compile from scratch, that was using a compile farm of 4 machines though (each one probably a recent dual-core P4 or Athlon - not really sure.)
reedbeta.com - developer blog, OpenGL demos, and other projects

#3 Mattias Gustavsson

    Senior Member

  • Members
  • PipPipPipPip
  • 413 posts

Posted 28 September 2007 - 07:44 AM

My (small) game I'm doing on my own takes 32 seconds to do a full build. I'm doing some contract work on a big AAA title, and it takes just over 5 minutes for a full rebuild. Both on a P4 3 Ghz.

I've worked on lots of projects with unnecessary long compile times. It's actually quite easy to reduce compile times; just avoiding including header files from header files makes a massive difference.

#4 Dia

    DevMaster Staff

  • Administrators
  • 1090 posts

Posted 28 September 2007 - 08:51 AM

The project I'm working on takes around 10 min to compile using the VC++ compiler, but takes around 3 min to compile when utilizing Incredibuild...it's one of those tools that once you use, you can't live without :D

#5 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 28 September 2007 - 09:06 AM

I reduced my build time by 30% with a Western Digital 'Raptor' hard disk. Now I'm waiting for SSD's to become affordable. :whistle:

Mattias Gustavsson said:

It's actually quite easy to reduce compile times; just avoiding including header files from header files makes a massive difference.
Very true. Every year or so I go through all my source files and I systematically remove all unnecessary header files. I takes half a day but it pays off for the rest of the year.

I wonder whether there's any tool that can do this automatically... I've also been looking for something that continuously compiles in the background so when I hit F5 (Visual C++) it only has to to compile the most recently changed files. :huh:

#6 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 28 September 2007 - 09:34 AM

Mattias Gustavsson said:

I've worked on lots of projects with unnecessary long compile times. It's actually quite easy to reduce compile times; just avoiding including header files from header files makes a massive difference.
I know. I've already reduced the dependencies on the subsystems I work on throughout the game - it's a pain to see a quarter of the game to rebuild when you change a single header file. Then again, there's a limit as to how far you can go. If your project inherently needs all those dependencies you're simply stuck :D. Nested classes for example are typical dependency whores as you can't forward declare them

Dia said:

The project I'm working on takes around 10 min to compile using the VC++ compiler, but takes around 3 min to compile when utilizing Incredibuild...it's one of those tools that once you use, you can't live without :)
Yeah I think that is being investigated at the moment. As for the content builds, we are currently in the process of making our build system distributed
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#7 monjardin

    Senior Member

  • Members
  • PipPipPipPip
  • 1033 posts

Posted 28 September 2007 - 02:39 PM

.oisyn said:

Nested classes for example are typical dependency whores as you can't forward declare them
I'd say you could place them in a namespace to keep them out of global scope, but I imagine you're doing some template trickery that requires them to be nested...
monjardin's JwN Meter (1,2,3,4,5,6):
|----|----|----|----|----|----|----|----|----|----|
*

#8 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 28 September 2007 - 03:10 PM

monjardin said:

I'd say you could place them in a namespace to keep them out of global scope, but I imagine you're doing some template trickery that requires them to be nested...
I was talking in general, not specifically to our project. Of course you could make the classes not nested, but if it's a good choice from a design perspective, then why not make use of it?

Now, a real solution would be C++ modules :D
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#9 J22

    Member

  • Members
  • PipPip
  • 92 posts

Posted 30 September 2007 - 09:10 AM

Our game takes around 4mins with IncrediBuild for Xbox360, including linking (around 100GHz farm speed). Haven't tried without IncrediBuild for long time.

#10 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 30 September 2007 - 04:34 PM

100GHz? That's a lot of farm!
reedbeta.com - developer blog, OpenGL demos, and other projects

#11 J22

    Member

  • Members
  • PipPip
  • 92 posts

Posted 30 September 2007 - 09:10 PM

Not that much actually. Just around 20 IncrediBuild agents running on 3GHz dual core machines.

#12 gardon

    Valued Member

  • Members
  • PipPipPip
  • 282 posts

Posted 02 October 2007 - 02:25 AM

Visual studio has a method to only re-compile those files that have changed.

#13 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 02 October 2007 - 09:11 AM

No shit :D. I think every build system out there has that option.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#14 Nick

    Senior Member

  • Members
  • PipPipPipPip
  • 1225 posts

Posted 02 October 2007 - 10:26 AM

gardon said:

Visual studio has a method to only re-compile those files that have changed.
As do most compilers. And it has several other tricks to limit compilation time.

But unfortunately it's not perfect. If you externally change project related files you might want to do a full rebuild. Also, when you're doing regression tracking you have to build multiple older versions. If the full compilation time is only a couple minutes you can 'manually' search for the change that caused the regression. But if it takes longer you either need an automated method for regression tracking, or find ways to shorten your compilation time...

So no matter how clever the compiler is, it never hurts to keep your compilation times limited by checking header dependencies and maximizing your system's efficiency. If you know of any compiler tricks that are less known we'd love to hear about them though.

Some other advise I can give to keep compilation times low is to code only what you need, deprecate early, and K.I.S.S. It's very tempting to 'think ahead' and add features that you might or might not need later. It's not only a waste of time if it turns out you don't need it later (9 out of 10), it also makes compilation time longer than necessary. Don't be afraid to deprecate code and remove it entirely. It's distracting and again eats away compilation time. Rely on your versioning, backup and/or archive systems to store the old code. And finally keep your designs simple. If you can do something adequately with a global table of function pointers, don't use a hierarchy of abstract classes with a singleton facade. Always refactor to simpler constructs if they are more suited for the situation.

#15 gardon

    Valued Member

  • Members
  • PipPipPip
  • 282 posts

Posted 02 October 2007 - 03:34 PM

.oisyn said:

No shit :p. I think every build system out there has that option.

No shit, no shit (lol). Nick said he wanted to "compile the most recently changed files". Just making sure he knew :)

#16 m4x0r

    New Member

  • Members
  • PipPip
  • 25 posts

Posted 02 October 2007 - 05:05 PM

Compile times have never been that big of an issue for me since you rarely need to do a full build (and you can keep the dependencies low if you're careful). Linking times on the other hand have been a big problem. On the last big project I worked on, a link could take up to 10 minutes. Does anyone have advice on how to reduce those?

#17 TheNut

    Senior Member

  • Moderators
  • 1398 posts
  • LocationThornhill, ON

Posted 02 October 2007 - 05:10 PM

It usually takes 5-10 seconds with my own projects. My engine takes about 20 seconds to compile on either Winjoes or Leenux. It's whistle clean goodness ;)

The stuff I do at work takes anywhere from 10-20 minutes. I have a script that I execute on the build machine that automagically builds everything. From downloading the latest sources, compiling, organizing, configuring, and installing. Of course I don't let the boss know cauz then he'd be like "WTF?! am I paying you for instead of the machine" :lol:

Now if only I can invent AI that makes games. I could sleep-in every morning :lol:
http://www.nutty.ca - Being a nut has its advantages.

#18 .oisyn

    DevMaster Staff

  • Moderators
  • 1810 posts

Posted 02 October 2007 - 06:26 PM

m4x0r said:

Compile times have never been that big of an issue for me since you rarely need to do a full build (and you can keep the dependencies low if you're careful). Linking times on the other hand have been a big problem. On the last big project I worked on, a link could take up to 10 minutes. Does anyone have advice on how to reduce those?

The visual studio compilers support incremental linking. I don't know whether gcc does, however.
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.

#19 J22

    Member

  • Members
  • PipPip
  • 92 posts

Posted 02 October 2007 - 06:43 PM

m4x0r said:

Compile times have never been that big of an issue for me since you rarely need to do a full build (and you can keep the dependencies low if you're careful). Linking times on the other hand have been a big problem. On the last big project I worked on, a link could take up to 10 minutes. Does anyone have advice on how to reduce those?
An ugly way to reduce link times is to create few cpp files that #include many cpp files and compile those cpp files instead. Of course if you edit a cpp file that's included in a big one, it causes the big cpp file to recompile, but you might want to try it out anyway if it still compensates the long link times.

#20 Reedbeta

    DevMaster Staff

  • Administrators
  • 4782 posts
  • LocationBellevue, WA

Posted 02 October 2007 - 06:47 PM

A related, but perhaps not quite so hackish solution is to split a large program into a collection of DLLs. You'll only have to relink the libraries that were modified at each step. This might work for static libraries too, but I'm not sure. Of course, DLLs can introduce a whole host of other issues into your code, like having different memory allocators for each one.
reedbeta.com - developer blog, OpenGL demos, and other projects





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users