Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.os.linux.development.apps Subject: Re: g++ spent lots of user time Date: Thu, 02 Mar 2017 15:33:36 +0000 Lines: 35 Message-ID: <87d1dzpub3.fsf@doppelsaurus.mobileactivedefense.com> References: <9e7e5a19-9122-4b1a-9532-d938bb192a4d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net 6S/kxZ93kLnGUVdRaj34gASOobWjilnZyIteuiEQAb+FAiut0= Cancel-Lock: sha1:L8uTcVKQexPyIILVxXogU97iKdA= sha1:c6o6Zdv8i9V5rSoVRhRRDU8LF6Q= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) Xref: csiph.com comp.os.linux.development.apps:843 wij@totalbb.net.tw writes: > On Wednesday, March 1, 2017 at 10:50:14 PM UTC+8, Lew Pitcher wrote: [...] >> > ----------------- >> > $g++ --version >> > g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1) >> > ... >> > >> > $time g++ -c -Wall -pthread -fPIC dsmain.cpp >> > >> > real 6m10.623s >> > user 6m8.142s >> > sys 0m0.099s >> >> > Why did the compilation took so long in user time? [...] >> Your compilation tool a long time because the compiler was doing lots of >> complicated things that didn't require any system calls. [...] > Currently, almost every object files in the Makefile takes nearly 10 more > minutes to compile. So I think it should be mostly the 'feature' of newer g++ This strongly suggests that you're keeping the compiler busy with doing and re-doing loads of avoidable things. Considering that this is C++, that's almost certainly template-related. It should be possible to detemine the exact cause using #if 0 ... #endif to neutralize all of the code in this file and than re-activate it bit by bit until the problematic part has been found.