From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id D48D43861970 for ; Thu, 9 Jul 2020 21:28:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D48D43861970 Received: by mail-pl1-x630.google.com with SMTP id x11so1341871plo.7 for ; Thu, 09 Jul 2020 14:28:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=maRHxi08cyGOt3JjK66FtrApgmy7xf7A2E4kUN8oO1M=; b=dCBmEw+VTmjYtFfcuNNs5SDm1R1zyACeQ8Gz7t4t7KJB7tJ6kpjSQFvAkAxZPTwntN YFTS8ixP2j7X/hyqSSMM5xra/8ql/jJr+UssS8ZKKqNWQxU7/ChW0qt/Qb0uncCb8IYW iD3XjeWrCegQl73HOpuFHmyQ3G9gVUmdgRiBAY74jdWSPk10iiIPphu9tcES2sI3i/SV fQ9o440BJfW/FR7j9dG7WN/6jV9S/of5kikkjoKjAU6cChK6/pQ5QWdZJ/smjj2q+6pF t5sU0Fgzg9Ju51uXrmwPA7ewoscGsV8YlWDXBYmLTC551UqDy3tCmJk0m0Ii2rsw8uN8 zQgQ== X-Gm-Message-State: AOAM531a+IupHIl8c3ysmqpu0+wCnypTeF1x3aeRlG1CVP7CLOGuMicD +58mft27gfvvlUOZAYLKkb7rkC8DOY1Ky1YJVXvcwo62FrI= X-Google-Smtp-Source: ABdhPJx1YgSS7chD95VoJRlrij5hR1JlpPPa7kckk+616kF4MGCA6eoEkTblUXSSKjHM7clwsaJbkdf0PsM+Z5tQ+s8= X-Received: by 2002:a17:902:6906:: with SMTP id j6mr13218510plk.125.1594330089468; Thu, 09 Jul 2020 14:28:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mandeep Sandhu Date: Thu, 9 Jul 2020 14:27:58 -0700 Message-ID: Subject: Re: stdc++ issue: extremely long compile time with large number of string literals To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2020 21:28:12 -0000 > 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