This is the mail archive of the
mailing list for the GCC project.
Re: reduce compilation times?
- From: Brian Dessent <brian at dessent dot net>
- To: "J.C. Pizarro" <jcpiza at gmail dot com>
- Cc: Sven Eschenberg <eschenb at cs dot uni-frankfurt dot de>, gcc-help at gcc dot gnu dot org
- Date: Tue, 27 Nov 2007 08:07:01 -0800
- Subject: Re: reduce compilation times?
- References: <firstname.lastname@example.org>
- Reply-to: gcc-help at gcc dot gnu dot org
"J.C. Pizarro" wrote:
> * to use -O3 -fomit-frame-pointer -funroll-loops -finline-functions -fpeel-loops
This is exactly the opposite of what you should do if you're trying to
reduce compile time. -O3 includes marginal optimizations that increase
compile time and usually do not have substantial benefit. -O2 is meant
as a balance between decent optimization and compile speed. If you want
faster compile speed then you use -O1 or -O0, or (sadly) use an older
version of gcc. You certainly don't tell the compiler to try wild and
crazy stuff, just like you don't use gzip -9 if compression speed
> * to use SSE2/SSE/AltiVec (SSE3 is little bit slower)
> * to disable shared (it reduces linking time and paging time), to
> enable -static.
> * to recompile the shared libraries (that it depends) to static libraries.
> * to disable threads (they reduce I/O bandwith) if the program
> doesn't require threading
> * to disable checking (-DNDEBUG)
> * to modify optimizing their sources after profiled the runned
> testsuite (-pg, gprof)
These all have to do with runtime performance, not compile time.
Please, read the question.