The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Development PC

Currently I'm working on a large C++ project (VC++ 2005 compiler) and the code-compile-test cycle is getting inconveniently long (around 5 minutes) on my dual core 1 GB laptop (Dell M65).

I'm thinking about buying a speedy dedicated desktop for this task.
Can anybody tell me if this will improve the compile time a lot, and if so, what specs are most influencing?
amount of cores?

I'm under the impression that only clockspeed would matter; the harddisk seems barely busy and task manager indicates that only half of my memory is used and only one core is stressed during compile-time.


Corno Schraverus Send private email
Sunday, July 22, 2007
...5 minutes?!..
Very lucky!

VS 2005 has the multithreaded compilation feature - check the options. This may help or maybe not - I never tried it. I have 95 projects in a solution - full debug build takes 1 hour 40 mins or so and touching some main .H files will result in about 40 mins build.

Dlg: Tools -> Options
  Tree node: "Projects and Solutions" -> "Build and Run"
    Option: "Max. number of parallel project builds"
asmguru62 Send private email
Sunday, July 22, 2007
Alternatively , it may be interesting to spend some time investigating why the compiler takes so long. Is this a one-man project? If so, it's quite a feat to get to a point where compilation takes 5 minutes.

Generally, cleverly splitting a project into stand-alone modules and paying attention to your #include's will have a lot more effect on compile time than an ever faster CPU.
Jeroen Send private email
Sunday, July 22, 2007
Make sure you don't #include more then you need to, with special attention to recursive #includes.

Important tips

You _don't_ need to include a file for a complete class definition. A simple

class Foo;
struct Bar;

is enough to declare functions that take Foo and Bar pointers and references.

Make sure all intermediate, output files are on a local drive.

Make sure you're using precompiled headers.
Ori Berger Send private email
Sunday, July 22, 2007
I am aware that reorganizing a project could drastically improve compilation time.
I believe that in this project it is not the case as all the code is generated.
Even a small change in the higher level will regenerate all the code and therefore the compiler will have to recompile everything.
This in itself might be a very interesting topic, but for now I'm really interested in the hardware/platform aspects.

I will look up the multithread feature of VC++ (but if it exists, I wonder why it is not turned on by default)


Corno Schraverus Send private email
Sunday, July 22, 2007
You might find a distributed compilation more cost-effective: that way you can add horsepower just by hooking up cheap headless boxes to your network, and scale up almost indefinitely, instead of having a single expensive desktop that needs to be upgraded every time you need more computing resources.

If you were using the GNU toolchain, distcc would give you that for free, but it doesn't support Visual Studio.  There's a commercial product - Xoreax IncrediBuild - that does, but it's quite expensive, which changes the equations significantly: depending on your precise circumstances, it might not work out cheaper after all.
Sunday, July 22, 2007
Yeah, get the multicore Incredibuild, it will speed you up more than spending the equivalent amount of money on hardware.
Satisfied Incredibuilder
Monday, July 23, 2007
There is some points.

Are you use precompiled headers?
It's very speedup compilation, but I use it under Borland and don't know exactly how it is under MS.

And...  it is one hacking trick
Rather useful under Unix, but tricky under Win.
To use virtual drive, that place all project files into the memory and compile it there.
Aku-Aku Send private email
Monday, July 23, 2007

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz