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] New: 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 01:24:41 +0000	[thread overview]
Message-ID: <bug-94781-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 94781
           Summary: version 9.3 g++ compilation time is slower by 20% or
                    much more (closer to 50 % sometimes)  in comparison to
                    v7.
           Product: gcc
           Version: 9.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ishikawa at yk dot rim.or.jp
  Target Milestone: ---

Created attachment 48380
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48380&action=edit
-ftime-print log for V9, V8 and V7 g++ compiler compiling preprocessed
UnifiedBindings23.cpp

Thank you for maintaining the great package. I use GCC for PC and embedded
systems development.

I compile mozilla Thunderbird mail client source files using GCC to create
patches to fix the bugs of the mail client.

Lately, when I switched from GCC V7 to GCC v9, I noticed a great slowdown of
compilation time. I was hampered with other bugs which I sorted out and then 
the slow compilation time became very apparent.

I created a small awk script to check the compilation time of thunderbird
source files.
The following is what I found.

top 20  in terms of elapsed time for g++-7 compilation time.
 165.097862 :   UnifiedBindings23.cpp
 102.842003 :   UnifiedBindings1.cpp
 102.387905 :   Unified_cpp_dom_base2.cpp
 79.692992  :   Unified_cpp_layout_generic2.cpp
 78.299717  :   UnifiedBindings4.cpp
 78.239538  :   Unified_cpp_dom_ipc0.cpp
 77.236254  :   Unified_cpp_src_peerconnection0.cpp
 75.737330  :   UnifiedBindings12.cpp
 72.586055  :   Unified_cpp_dom_canvas0.cpp
 72.564836  :   UnifiedBindings10.cpp
 72.556511  :   UnifiedProtocols12.cpp
 71.924969  :   Unified_cpp_layout_painting0.cpp
 70.908968  :  
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/dom/indexedDB/ActorsParent.cpp
 70.167488  :   UnifiedBindings3.cpp
 69.194670  :   UnifiedBindings22.cpp
 68.657080  :   UnifiedBindings21.cpp
 68.106164  :   Unified_cpp_docshell_base0.cpp
 67.494041  :   Unified_cpp_layout_base1.cpp
 65.638745  :   Unified_cpp_dom_canvas4.cpp

top 20  in terms of elapsed time for g++-9 compilation time.

Elapsed time 259.956334  :  UnifiedBindings23.cpp
Elapsed time 149.609287  :  UnifiedBindings1.cpp
Elapsed time 132.656618  :  Unified_cpp_layout_generic2.cpp
Elapsed time 125.823251  :  Unified_cpp_dom_base2.cpp
Elapsed time 113.072732  :  UnifiedBindings4.cpp
Elapsed time 107.252363  :  Unified_cpp_layout_painting0.cpp
Elapsed time 100.176409  : 
/NEW-SSD/NREF-COMM-CENTRAL/mozilla/dom/indexedDB/ActorsParent.cpp
Elapsed time 99.760067   :  UnifiedProtocols12.cpp
Elapsed time 99.549702   :  Unified_cpp_dom_canvas0.cpp
Elapsed time 99.372578   :  Unified_cpp_dom_ipc0.cpp
Elapsed time 97.947955   :  Unified_cpp_image_test_gtest0.cpp
Elapsed time 97.134518   :  UnifiedBindings21.cpp
Elapsed time 95.530481   :  UnifiedBindings3.cpp
Elapsed time 94.182883   :  UnifiedBindings12.cpp
Elapsed time 92.836375   :  Unified_cpp_src_peerconnection0.cpp
Elapsed time 92.755637   :  Unified_cpp_editor_libeditor1.cpp
Elapsed time 91.168096   :  UnifiedBindings7.cpp
Elapsed time 90.080235   :  UnifiedBindings10.cpp
Elapsed time 89.838960   :  Unified_cpp_layout_base1.cpp

You can see that the compilation time slows down by about 20 % most of the time
and 30, 50% slow down can be observed for the top two files.

I am going to show the -ftime-print output for the compilation of V9, V8, V7
g++ compiler of the same file in the attachment.
But do note that mozilla Thunderbird configure script is very clever and try to
add as many options as supported to each version of the compiler and thus,
obviously v9 compiler may be doing a bit more than other version.

Oh, yes, the slowdown has happened in v8 already (!)

In the attachment, you can see that v8 and v9 are equally slow in terms of
elapsed time.
I can see that "phase last asm" has large elapsed time for v8 and v9 in
comparison to v7. Otherwise, I could not see a clear smoking gun.

The elapsed time of v7 and V9 arey  133 and  159sec for UnifiedBindings23.cpp
(prepressed). But this difference is obviously inflated in real world workload
when the compilation is run in parallel with "make -j6" in a 7 hypercore
VirtualBox image.

In any case, a single thread run has about 26 second difference which is about
20% slower already. Any possible hint or fix for speedup is appreciated.
The compilation time slowdown hurts.: now building thunderbird in my spare time
is a one night job after modifying a few source file. I used to check the
behavior of modified binary before going to bed at least shortly and let a test
suite run.  I can't do that any more. Any checking needs to be done the next
day...

             reply	other threads:[~2020-04-27  1:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-27  1:24 ishikawa at yk dot rim.or.jp [this message]
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
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@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).