public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mandeep Sandhu <mandeepsandhu.chd@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Re: stdc++ issue: extremely long compile time with large number of string literals
Date: Thu, 9 Jul 2020 14:27:58 -0700	[thread overview]
Message-ID: <CAC+QLdQRO9Sbzi-xgeCE=7QFn7FeZFA96eX2PyMazwUohOca8g@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.23.453.2007092243400.6317@stedding.saclay.inria.fr>

> You didn't say what flags you are using. For anything autogenerated like
> that, going above -O1 is always risky.

I run it with just -std=c++11 (not optimization flag, so I guess it
defaults to -O0)
>
> One first thing to try is -ftime-report
>
> At -O0
>   phase opt and generate             :   3.46 ( 84%)   0.15 ( 45%)   3.62 ( 81%)  188385 kB ( 70%)

With 5000 strings, & -O0 I get the following in the time report:

Time variable                                   usr           sys
    wall               GGC
...
phase opt and generate             :   4.12 ( 89%)   0.18 ( 46%)
4.30 ( 86%)   99680 kB ( 58%)
...
 expand vars                        :   2.41 ( 52%)   0.00 (  0%)
2.42 ( 48%)     699 kB (  0%)
...

TBH, not sure what these values mean. Someone mentioned that overload
resolution might be causing the excessive delay, but I can't find any
metrics to verify that.

-mandeep


>
> without a specific pass that stands out.
>
> At -O1
>   phase opt and generate             :  87.96 ( 99%)   6.57 ( 97%)  94.56 ( 99%)24503776 kB (100%)
>   callgraph ipa passes               :  85.93 ( 97%)   6.52 ( 96%)  92.47 ( 97%)24413253 kB ( 99%)
>   tree eh                            :  84.32 ( 95%)   6.43 ( 95%)  90.78 ( 95%)24340697 kB ( 99%)
>
> so, it looks related to the optimization of exceptions...
>
> --
> Marc Glisse

  reply	other threads:[~2020-07-09 21:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-09 20:31 Mandeep Sandhu
2020-07-09 20:49 ` Marc Glisse
2020-07-09 21:27   ` Mandeep Sandhu [this message]
2020-07-09 23:49 ` Jonathan Wakely
     [not found]   ` <CAC+QLdRqjTe4YsUpQRcLG7tpxGda0oh6H788ORZa5MQR3NqRbw@mail.gmail.com>
     [not found]     ` <CAH6eHdTRiwA3t1K3okfVc+umPM8PJfbePaO7AHdLz+SYPOU9XQ@mail.gmail.com>
2020-07-10 19:36       ` Mandeep Sandhu
2020-07-10 20:25         ` Jonathan Wakely
2020-07-11  6:27           ` Mandeep Sandhu

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='CAC+QLdQRO9Sbzi-xgeCE=7QFn7FeZFA96eX2PyMazwUohOca8g@mail.gmail.com' \
    --to=mandeepsandhu.chd@gmail.com \
    --cc=gcc-help@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).