This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Faster compilation speed

After I first built GCC, G++ & GCJ etc (3.0) on my x86 300MHz , 32Mb machine I
began to seriously consider how to increase compilation speed. The full build
would have taken at least nine hours. This is why I only built GCC, G++ for 3.1

>From the projects I've worked on most software is devided into modules and each
module has common headers and options and generally several files. As such all
the headers are pre-processed and parsed for every file that needs to be
compiled. Pre-Compiled Headers allow the compiler to load the parsed code.

But why load and unload the compiler and the headers for every file in a
module. It would be far more effecient to adapt the build process and start gcc
for the module and then to tell it to compile each file that needs to be
re-compiled. Add pre-compiled header support and it wouldn't even need to
compile the headers once.

This is how you might implement in unix ...

Add a compiler directive to the front end that causes the compiler to compile a
e.g. #pragma gcc reset
e.g. #pragma gcc compile -o file.o -c file.c
e.g. #pragma gcc quit
Add a make system to start gcc reading from a named pipe. 
For each module issue a 'reset' directive to the pipe.
  Then issue a directive to set the compiler options.
  For each file in the module issue a compile directive to the pipe.
When your finished issue a quit directive.

If only gcc uses this capability it will be good as it would allow a much
faster boostrap in the later more complex stages. Making use of amd work on GCC
practical for more people. - Yahoo! Digital How To
- Get the best out of your PC!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]