public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ishikawa at yk dot rim.or.jp" <gcc-bugzilla@gcc.gnu.org>
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	[thread overview]
Message-ID: <bug-94781-4-xjqlVRze53@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94781-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94781

--- Comment #5 from ishikawa,chiaki <ishikawa at yk dot rim.or.jp> ---
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 
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 ( 12%) 
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%) wall 
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:
> 
> > /usr/bin/time /space/rguenther/install/gcc-7.5/bin/g++ -S UnifiedBindings23-v7.cpp -std=gnu++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 UnifiedBindings23-v7.cpp -std=gnu++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 UnifiedBindings23-v7.cpp -std=gnu++1z -w -O2
> 128.28user 1.90system 2:19.51elapsed 93%CPU (0avgtext+0avgdata
> 2695708maxresident)k
> 
> Note how my GCC 8 build is significantly faster than GCC 7!

Hmm... 

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.)

> 
> 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
> 
> > size UnifiedBindings23-v7.o
>    text    data     bss     dec     hex filename
> 2502864   10136   37392 2550392  26ea78 UnifiedBindings23-v7.o
> 
> while GCC 9 generates
> 
> > size UnifiedBindings23-v7.o
>    text    data     bss     dec     hex filename
> 2788944   16488   37392 2842824  2b60c8 UnifiedBindings23-v7.o
> 
> I realize I didn't use the full set of options you did (in particular I
> omitted
> -g).  

The few extra options I needed to omit for v7 and v8 might explain the 
slow down. I will check for this by removing the options from v9 compilation 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 :-)

  parent reply	other threads:[~2020-04-27 10:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  1:24 [Bug c++/94781] New: " ishikawa at yk dot rim.or.jp
2020-04-27  1:55 ` [Bug c++/94781] " ishikawa at yk dot rim.or.jp
2020-04-27  4:25 ` marxin at gcc dot gnu.org
2020-04-27  4:50 ` ishikawa at yk dot rim.or.jp
2020-04-27  7:17 ` rguenth at gcc dot gnu.org
2020-04-27 10:09 ` ishikawa at yk dot rim.or.jp [this message]
2020-05-05  8:23 ` marxin at gcc dot gnu.org
2020-05-06  7:02 ` ishikawa at yk dot rim.or.jp
2020-05-06  7:16 ` ishikawa at yk dot rim.or.jp
2020-05-06  8:59 ` marxin at gcc dot gnu.org
2020-05-06  9:19 ` ishikawa at yk dot rim.or.jp
2020-05-06  9:24 ` marxin at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94781-4-xjqlVRze53@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).