From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8B33E3858D20; Mon, 14 Nov 2022 13:03:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B33E3858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668431008; bh=b5DWEB93wYbKLafKIprZQO149p/Vp06dAHoc3avbU6A=; h=From:To:Subject:Date:From; b=HmCIPkYwk3O+/oaOKPPt+Y0w+O4snkaVirb9O1V4gohpJj00TwmRPRDpXTKcvLZja 3i0x0Oi1THwnFtKKUV8Df6tHTZ8Zu5hdQbuzRkNrUMoyi6yZX3GyoTUYbSl9p4SjQ1 jraXvy88i3fHFlsv9VKyTWeFKZ5u/QZePkhh/+Tc= From: "tnfchris at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107675] New: [13 Regression] GCC-13 is significantly slower to startup on C++ programs Date: Mon, 14 Nov 2022 13:03:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tnfchris at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107675 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 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 responsi= ble for the 2x slower startup. Is it possible to mitigate this? At startup it's currently executing more t= han 6.5x the number of instructions as GCC-12 which is quite noticeable on small devices.=