Boost logo

Boost :

From: John Torjo (john.lists_at_[hidden])
Date: 2003-10-17 04:51:03


Dear boosters,

Although I'm currently working on the SMART_ASSERT library, I'm willing to
stop for a little, and follow this idea.

When it hit me, I couldn't believe its simplicity, and think it would be
quite useful for a lot of projects.

*** Fighting compilation times ***

This issue appears more and more, even if computers/ compilers are getting
faster, mostly due to templates, but not limited to (also, see Eric
Niebler's latest article on CUJ).

I'm working on a (huge) application, which contains 6 projects, each taking
more than 5 mins. to compile. That wouldn't be a problem, but modifying
something triggers a lot of source files to be recompiled.

What I want to know is ***where*** should I minimize dependencies (based on
the old mighty: don't optimize too soon strategy).

So, what can be done, is to have a small utility header file included in ALL
compilable files from your custom project (the files that you or your
company own and can modify).

This would be something similar to this:

#define COMPILE_FILE __FILE__
#include "boost/compile_profiler.hpp"

(a script to include this in every file from your project I assume is quite
easy to do).

The compile_profiler.hpp will contain amongst others, something similar to

namespace {
   some_class var( __DATE__, __TIME__, COMPILE_FILE);
}

This will allow for:
Throughout two consecutive compilations, you will know EXACTLY which files
got recompiled (and eventually, dependencies). This is then used to create a
database of such changes (this can also be improved, to contain the names of
the classes/ functions that were modified, etc.).

A program will then be created that will analyze this database, and in time,
it can suggest to you ***where*** you should minimize dependencies.
I think this would be very valuable for large projects.

So, any interest in such a library?

Best,
John

(note: I'll be off from tomorrow, until Tue or Wed - I'm moving to a new
location).

--
John Torjo
-- "Practical C++" column writer for builder.com.com
Freelancer, C++ consultant
mailto:john_at_[hidden]

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk