This is the mail archive of the
mailing list for the GCC project.
Re: Faster compilation speed
- From: Mat Hounsell <mat_geek at yahoo dot com dot au>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 16 Aug 2002 18:28:37 +1000 (EST)
- Subject: 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.
http://digital.yahoo.com.au - Yahoo! Digital How To
- Get the best out of your PC!