Compilation strategy

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Dec 15 10:43:00 PST 2012


On Sat, Dec 15, 2012 at 07:30:52PM +0100, RenatoUtsch wrote:
> On Saturday, 15 December 2012 at 18:00:58 UTC, H. S. Teoh wrote:
[...]
> >So perhaps one possible middle ground would be to link packages
> >separately, but compile all the sources within a single package at
> >once.  Presumably, if the project is properly organized, recompiling
> >a single package won't take too long, and has the perk of optimizing
> >for size within packages. This will probably also map to SCons
> >easily, since SCons builds per-directory.
[...]
> Well, the idea is good. Small projects usually don't have much
> packages, so there will be just a few compiler calls. And compiling
> files concurrently will only have a meaningful efect if the project
> is large, and a large project will have a lot of packages.

Yes, that's the idea behind it.


> Maybe adding an option to choose between compiling all sources at
> once, per package, or per source. For example, in development and
> debug builds the compilation is per file or package, but in release
> builds all sources are compiled at once, or various packages at once.
> 
> This way release builds will take advantage of this behavior that
> the frontend has, but developers won't have productivity issues.
> And, of couse, the behaviour will not be fixed, the devs that are
> using the build system will choose that.

I forgot to mention also, that passing too many source files to the
compiler may sometimes cause memory consumption issues, as the compiler
has to hold everything in memory. This may not be practical for very
large project, where you can't fit everything into RAM.


T

-- 
Stop staring at me like that! You'll offend... no, you'll hurt your eyes!


More information about the Digitalmars-d mailing list