public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/107675] New: [13 Regression] GCC-13 is significantly slower to startup on C++ programs
@ 2022-11-14 13:03 tnfchris at gcc dot gnu.org
  2022-11-14 13:09 ` [Bug libstdc++/107675] " tnfchris at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: tnfchris at gcc dot gnu.org @ 2022-11-14 13:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107675
           Summary: [13 Regression] GCC-13 is significantly slower to
                    startup on C++ programs
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tnfchris at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64*

The following simple testcase:

#include <cstdio>

int main(int argc, char** argv) {
    printf("Hello world\n");
    return 0;
}

is on average twice as slow as GCC 12 during startup:

> perf diff perf.data.gcc.12 perf.data.gcc.13

# Event 'cycles'
#
# Baseline  Delta Abs  Shared Object     Symbol
# ........  .........  ................  ...............................
#
   100.00%    +42.66%  gcc-13.exe        [.] fde_single_encoding_compare

Looking at perf the entirety of of the difference is spent in __libc_start_main
which on GCC 13 calls __libc_csu_init which calls init_object.constprop.0.

This constprop function spends half the time in frame_heapsort and the other
half in fde_single_encoding_compare.  Together these two calls are responsible
for the 2x slower startup.

Is it possible to mitigate this? At startup it's currently executing more than
6.5x the number of instructions as GCC-12 which is quite noticeable on small
devices.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2022-12-20 15:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 13:03 [Bug libstdc++/107675] New: [13 Regression] GCC-13 is significantly slower to startup on C++ programs tnfchris at gcc dot gnu.org
2022-11-14 13:09 ` [Bug libstdc++/107675] " tnfchris at gcc dot gnu.org
2022-11-14 13:20 ` jakub at gcc dot gnu.org
2022-11-14 13:27 ` fw at gcc dot gnu.org
2022-11-14 14:28 ` tnfchris at gcc dot gnu.org
2022-11-14 17:54 ` pinskia at gcc dot gnu.org
2022-11-14 17:55 ` pinskia at gcc dot gnu.org
2022-11-17 11:04 ` tnfchris at gcc dot gnu.org
2022-11-17 11:15 ` fw at gcc dot gnu.org
2022-11-17 11:24 ` tnfchris at gcc dot gnu.org
2022-11-20 23:57 ` tnfchris at gcc dot gnu.org
2022-11-20 23:58 ` [Bug libgcc/107675] " tnfchris at gcc dot gnu.org
2022-11-22  9:35 ` tnfchris at gcc dot gnu.org
2022-12-09 19:56 ` [Bug libgcc/107675] [13 Regression] GCC-13 is significantly slower to startup on C++ statically linked programs m.cencora at gmail dot com
2022-12-09 22:46 ` tneumann at users dot sourceforge.net
2022-12-16 23:55 ` tneumann at users dot sourceforge.net
2022-12-20 15:38 ` rguenth at gcc dot gnu.org

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