This is the mail archive of the gcc@gcc.gnu.org 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: Suggestions for improving gcc 3.2 compilation speed?


Joel Sherrill wrote:

"Kaveh R. Ghazi" wrote:


> I've been running gcc 2.95.3 on a 1Ghz/512MB RAM PC running RedHat
> 7.2. It takes 20 minutes to compile my application, so I recently got
> a new computer to reduce the time I wait for compiles. This new
> computer is a 2.8 Ghz CPU/1GB RAM running RedHat 8.0. Since RedHat 8.0
> comes with gcc 3.2 I figured I'd give it a try. It takes 20 minutes to
> compile my application. (!!!)
>
> I'm a little frustrated that the compilation speed is so slow with gcc
> 3.2, especially since this is a commercial application (i.e., this is
> my job). Is there anything I can do to improve the compilation speed?
> Will newer gcc releases be as fast as gcc 2.95.3 (or faster)? Or is my
> best bet to stick with 2.95.3?

With 1GB of RAM, try this patch it might help some. But on machines
with less memory it may cause thrashing, so it's not a general
solution.



Have you tried using some parallelism in your build? I work on an application with 425K lines of mostly C++ which we build for two target OSes. It takes about 20 minutes on a 2.4 Ghz dual Xeon
with 2 GB RAM. We added a -j option to make and the build time dropped to a little under 8 minutes. The parallel make keeps the
CPU busy while the OS is accessing the disk to read source files
and write objects. The difference in CPU utilization is incredible.
The non-parallel make only hit about 25% CPU utiliization. The
parallel version stays close to 100% for most of the build.


Good thought. I tried it this morning: both compiles (with and without the -j make option) take 18 minutes (more officially timed then my glance at the clock timing).

--Anna



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