From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7BFE8389782C; Mon, 27 Apr 2020 10:09:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BFE8389782C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587982196; bh=wTmw4Rm4HoX8g2K35FNpGdSO2qQxiHzI0zwYnCTDsxI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Med1ucYUjIK5JytTvniO5suVzD9uyt1S+NhOLqSuAORKBqbAoGE2hdJRbRsBcDXe4 52+HfjCGtVRSgHe3W+t+3XHSQ2VYnoTMFFWLeBEc+iV36AH6mEEgeAafse565P06kn G4Nziegg8JuGQuiFSz/T+OGYk32w9dCULelVanbg= From: "ishikawa at yk dot rim.or.jp" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94781] version 9.3 g++ compilation time is slower by 20% or much more (closer to 50 % sometimes) in comparison to v7. Date: Mon, 27 Apr 2020 10:09:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.3.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: ishikawa at yk dot rim.or.jp X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 10:09:56 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94781 --- Comment #5 from ishikawa,chiaki --- Thank you for your comment. (In reply to Richard Biener from comment #4) > The time-report you attached is mostly flat and I don't see anything > eye-popping pointing at a regression. With -O0 my GCC9 is faster (well, > noise). I was concerned with the ELAPSED time, and=20 I notice that, in my testing, "phase last asm" of v9 and v8 spent a tad long time than v7. v9 phase last asm : 6.03 ( 5%) 0.24 ( 2%) 19.07 ( 1= 2%)=20 127204 kB ( 2%) v8 phase last asm : 5.62 ( 4%) 0.24 ( 2%) 15.43 ( = 10%) 103215 kB ( 2%) v7 phase last asm : 4.03 ( 3%) usr 0.16 ( 1%) sys 6.51 ( 5%) wa= ll=20 101000 kB ( 2%) ggc v9 spends more than 12 seconds and v8 spends about 9 seconds longer than v7. But I am not sure what this "phase last asm" does and why it spends more ELAPSED time in v9 and v8 than in v7. > Confirmed for -O2: >=20 > > /usr/bin/time /space/rguenther/install/gcc-7.5/bin/g++ -S UnifiedBindin= gs23-v7.cpp -std=3Dgnu++1z -w -O2 > 112.50user 1.83system 2:01.65elapsed 93%CPU (0avgtext+0avgdata > 2732664maxresident)k > 1952inputs+36528outputs (6major+678054minor)pagefaults 0swaps > > /usr/bin/time /space/rguenther/install/gcc-8.4/bin/g++ -S UnifiedBindin= gs23-v7.cpp -std=3Dgnu++1z -w -O2 > 83.44user 1.27system 1:26.34elapsed 98%CPU (0avgtext+0avgdata > 2789396maxresident)k > 48640inputs+41088outputs (62major+687702minor)pagefaults 0swaps > > /usr/bin/time /space/rguenther/install/gcc-9.3/bin/g++ -S UnifiedBindin= gs23-v7.cpp -std=3Dgnu++1z -w -O2 > 128.28user 1.90system 2:19.51elapsed 93%CPU (0avgtext+0avgdata > 2695708maxresident)k >=20 > Note how my GCC 8 build is significantly faster than GCC 7! Hmm...=20 Did you use special flag to create your compiler? I am using AMD Ryzen 7 1700 eight core CPU (my linux runs inside VirtualBox image under Windows 10 and it is assigned 7 virtual CPU core.). Maybe I need to build my own G++ compiler tuned for AMD Ryzen 7 if you used= a special compiler flags when you built your V8 and V9 compiler because the elapsed time difference between v7 and v9 is rather smallish in comparison = to the difference I observed on my PC (module the option difference.) >=20 > note that this kind of regression can easily happen because we generate > more code because of some different optimization decisions. For example > the GCC 8 generated object is >=20 > > size UnifiedBindings23-v7.o > text data bss dec hex filename > 2502864 10136 37392 2550392 26ea78 UnifiedBindings23-v7.o >=20 > while GCC 9 generates >=20 > > size UnifiedBindings23-v7.o > text data bss dec hex filename > 2788944 16488 37392 2842824 2b60c8 UnifiedBindings23-v7.o >=20 > I realize I didn't use the full set of options you did (in particular I > omitted > -g).=20=20 The few extra options I needed to omit for v7 and v8 might explain the=20 slow down. I will check for this by removing the options from v9 compilatio= n as well. > My tests also seem noisy (machine isn't idle, 2nd run of the GCC 9 > compile > dialed in at 100s) I bet you are using very fast CPU :-)=