From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074107.outbound.protection.outlook.com [40.92.74.107]) by sourceware.org (Postfix) with ESMTPS id 04E913856DEB for ; Fri, 24 Jun 2022 00:19:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 04E913856DEB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vittorioromeo.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=outlook.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cyAE9Vk79guZu2io5BM5hOIzLko5N8QYaeg4Z+svA55T7JsF7unnXNYTHTdF9kRLLlQrtmaiSkMN5ai0/z/21i8mcrdjpEstZDVDrMlk7Ta5DP02UBn+9Q0HvROmXpT03pbjDkwl+Qx8PhZ5VxaZ4RjrXPVEHQqj1/Q7F/jfq4u9P2QHKxYLdKvVaT1AWk7vT+8oZc0rOQkniajvr/pxdLVFdTjQ6dOyvYRBALZEESR+aG8eqZ4zUYT+JFpNdycEqnAb4UtNvDtXZb/uPSxG8WNmCC/2dS6twv/GcWEAJkoHKjjUuAlpDNOjMncSf1UW/4eUo0SmWw9dVLNWJUdXoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=nABUAAZEYaH+nINKr0rjBHuj5fsU8XMDRTg6iMW3kkY=; b=Z4kgmCv4XsmThcK52eJ3/NDBPAyr1VNDNfBAfe9DYacicVWYz7+Eiy61SuTpOW33zi+MPeekQRORJG73Z4tkZ6PMgEB9xY7PaZfMvAJO4CADukslM7b/ygMGrbul+LVh/1B0xF4I/lfFHMDVCcLVgXnqgwUHdO/84Q5Gle/H86RwGosi3JHjmeFmBKohdFNOymJ7HckPSIyViQ/8OedYTaXcpIl9K/FhuMFE6iocQvIq3Sf912O65qywUcApQIFYtgayWPbzx3/f0S77qUA/Nb1MZQOYLHuZ0TNo8lM1uZv5hgPwSY9pxJ6cCAX5Nv1L1zHYZY3jjkgB73uyx9XAdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nABUAAZEYaH+nINKr0rjBHuj5fsU8XMDRTg6iMW3kkY=; b=Y2snHsiK17EPWbxb0+UsFA30cAxH89oQpT9RlL/nSgxzwJsfxbLPCvXY8wWfhlMmBmjdtUX25O4iMiTnOsaUFgr1fLdUcmmW8mryKQ6yKaYE7GXHNiXYb1oEFwQcQw+rJEHXXDu9XCKI4QE2n1+Rw1nq7jDS+pRju7liUDYPX7uSh2Sr3kz2ux4PFl4M7EwAobJhch1tlQDyW6706zn6W7hYnCh/7MO/wHDufaqd4yCtm6KTUkxcERtzb7lXbkQmJLrEZ+MtDdaFpWITG3iMI+N95WGikH+Cu9O0X4b6lxGSBAgFvROmba1SbeeXGT1Tz2dA+Y38dPSRx7dzzJdwkg== Received: from DU0P189MB2067.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:3bc::15) by DU2P189MB1799.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:2d2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Fri, 24 Jun 2022 00:19:26 +0000 Received: from DU0P189MB2067.EURP189.PROD.OUTLOOK.COM ([fe80::ac5e:d2c1:dba4:32b]) by DU0P189MB2067.EURP189.PROD.OUTLOOK.COM ([fe80::ac5e:d2c1:dba4:32b%6]) with mapi id 15.20.5373.016; Fri, 24 Jun 2022 00:19:26 +0000 From: To: "libstdc++@gcc.gnu.org" Subject: First-time contributor -- speeding up `std::unique_ptr` compilation Thread-Topic: First-time contributor -- speeding up `std::unique_ptr` compilation Thread-Index: AQHYh16sh+QBgQe+70mrZW6kBqWUjQ== Sender: Vittorio Romeo Date: Fri, 24 Jun 2022 00:19:26 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-exchange-messagesentrepresentingtype: 2 x-tmn: [uU+kAqSvbgH/xLu3ldic1KbjKKWK3t816zPGO6mhB1s+DbK+rtf1K3OfIgZf0U/7] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1f2004e9-bb86-4289-0eb7-08da55773282 x-ms-traffictypediagnostic: DU2P189MB1799:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: rH9l083cEkkhdnHhrZLTTuP2Lx/8KqMozzQhb5Jl68I9rSPDDTbmT0jiVvcNOIycGOaNcS0oAyuPy+3fVCcfPc0J/IbWtbMBWIt1u3GJrc7n+lhLvF1MGA29iMsLUsQSc0afng/izrSlsldCEvPvWMoaivXTvj6DznwZvFNSQRRsfSq10QBjhiDEOLOVic4nCOJs2mTMeZ27KQvHVbys+R4lWHDfoE3bMWCaGGxmoo8Lp/oCZ2HDNJRuB7omclNyx2n/kksUK+61BH9n91LkgkmP+anJePUB972Dm4FxzFQFVd8v6XMJvvGw6wG5sTihNyYi6XvXfTexnt1PXpEE+LsyKKyTbNI6FlDMQ2U84bR2/TvQFY6e63RkSxa5w/8oCX5jO6W7H6NOHgrFrOZcDMpKDwrAOVpywRIuJs5owFnwYqN47nch6ZRlo2HN+ijh1JaA5BeTxhai3o5S+2ZmmO7/+NkyQgAMRg8zMJiFld+csgkMIhun5WrVEAVOc6Uw9lfBNqhLx7JBVcj6mfx6eZqmmOMImOC+bRWzMcqeedq62SYlwdfSB5rnhfkEFhANy6W3R8aAk/y/TKXqW3X1bAg3Co7LILbCoyZi9v8q7OE712D3GiG5DPOXHt+suyTI x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?vydUNhdLEstlatnia0LrfWHhWSmsqTqfUEC8TwLP+2nnL6G9QupUBnVLTi?= =?iso-8859-1?Q?+5XwWfDIfCBSXjbGJSN6P+7a5V3fljv/StjzhLmb4qxiSrCk4XZqurLkIn?= =?iso-8859-1?Q?JGemdUF4ZBR847u7jd6uN2Ugaoe6mkX0L1Z072rGxOKvJwOsuZ6EmCMLqx?= =?iso-8859-1?Q?wUxR/iShl9xKpJc2udLMeYdioxy6ttSDTtSshcpUedBGmMCnxnC62p02vA?= =?iso-8859-1?Q?l+awW8bUt9Y9Zb1zlCgSLJ9uQfLIeRjozKfCfaO0sPoIysWOCwUpm5d9N3?= =?iso-8859-1?Q?yEolOYFyZNBogPMycnm2y58kzRs1sp0gvVDfPTWurEnnPkKtgQ4m75Htud?= =?iso-8859-1?Q?InI0yF3ioPdPCDmuiY+1zAEueMrC6f80YMd6AmEFaqE92LolvU00KnWFF0?= =?iso-8859-1?Q?RnerzGaGW3q3HT9I2Ay9oPCs6Nf02ik9a4dBorcRi2W6Z0wUVAizz3VQxj?= =?iso-8859-1?Q?AyLP8Y9nIA9vDp7GCJfYJf/PmvVWbbtRkZfG7vZo2Fc+FiTsC8f6crwz3w?= =?iso-8859-1?Q?TKMPc3UhBhi0bF0XhrNujAjs8GNrRfEsHQW1T2Y68DVZ1XLD/Pq4FyMM08?= =?iso-8859-1?Q?MD823LR7l0uCsWUSOw2COzhWQaUlg6r0KDMvSrAKKfSiWZf0KRTOA+H5kH?= =?iso-8859-1?Q?2+Pqy44xD6Vkk1LtpcrGjgttXA6bjI5ofTKlSi3W1EGy+XgkiBQOqKRjwz?= =?iso-8859-1?Q?wIM9nIiQZxvvNZm1PYkv+mqJoiLvZB0zEQXFRRrmqEWxigq/p0INlPl6jK?= =?iso-8859-1?Q?uWWfQj4dIdZTudrrSVqqpXw/MhHMI7hJ2CcmUTiVHy/R5kvDX34d+HPx6j?= =?iso-8859-1?Q?0+5dU6km/X3xbR4S72iqEmAO6GOcpZii3YLfQu9758AHZn9gP9zf4+JwDs?= =?iso-8859-1?Q?e+t8t3gxyS0DetS/CEpixIZ1HGyDQbfdBvhrd61Kx71DNM0gf22C2U0K1r?= =?iso-8859-1?Q?jn7uTyEBhcmEo++sQfSdG75Bw44or7scRaCJH4mOiWxqEej+57p+xiXv7t?= =?iso-8859-1?Q?mVQ2OeHzfLc5NBFyO0EKTuDTV7xxoYk7gfRyeZD68l6TBw7Nrt6LsfMhkz?= =?iso-8859-1?Q?7i+1HPtp4RcQ5DoVCdMS0IdTbgFMa2SCqs/5KqVqt3ey37Li9siwtMNoAY?= =?iso-8859-1?Q?7s3gNKByrgrVna+DrWvansdKfCDkJJSmMAu75zudYe1g/Jdu8mQMT0ObsU?= =?iso-8859-1?Q?ev+10qZ7KutDqcsLFBqaSG6awFwV6kt44+azA0XUFOVDMI8Q8q/cASWZ2m?= =?iso-8859-1?Q?r62MUgMsmjwq9NUcjPoWMqu1Y/2vZAwYWcWFMb3GCA1DrjR58vGHIrD/d2?= =?iso-8859-1?Q?vQE/QzJYLfcRLZZR2VuMo0yV8USKtAfTUlowe+eCEDCcdiyrwHJ1/qba0W?= =?iso-8859-1?Q?KU+JnpTppdFtH6KUTKhhuHb16+AjOtzeKuiIbx5Fwnaa94nW5n02s=3D?= MIME-Version: 1.0 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DU0P189MB2067.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 1f2004e9-bb86-4289-0eb7-08da55773282 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2022 00:19:26.3043 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P189MB1799 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 00:19:29 -0000 Hello everyone, Hope you are all doing well. I would like to begin by saying that I am terribly unfamiliar with mailing = lists and I've always found them cumbersome to use -- I tend to do most of = my development via GitHub PRs and Discord. Therefore, please forgive me if = this is not the right place to discuss "how to contribute", and also forgiv= e me for not being able to create a proper patch file. My goal is to generally improve the compilation speed of C++ programs using= the standard library. In personal projects and open-source projects I main= tain, I've achieved good results by benchmarking compilation via ClangBuild= Analyzer, figuring out the bottlenecks, and optimizing them. While working = on the SFML project, I noticed that the `std::unique_ptr` template was taki= ng a lot of time to be instantiated using the latest version of libstdc++. I investigated a bit, and figured out that the `` include and `std::= tuple` instantiation were the culprit. I then replaced them with a handmade= workaround in my system libraries, recompiled SFML, and noticed that `std:= :unique_ptr`'s instantiation time became negligible as a result of my chang= es. As a side benefit, we also avoid including the '' header altoget= her, reducing the risk of unintended transitive includes. I created a PR on= the GCC GitHub mirror as a way to observe the diff in a nice interface and= to discuss my changes, and to see if the maintainers generally think that = this is a good idea. You can see the diff here: https://github.com/gcc-mirror/gcc/pull/67/files?diff=3Dsplit&w=3D1 In terms of rough measurements, the average instantiation time of `std::uni= que_ptr` went from 22ms to 4ms. This was measured over the entire SFML code= base using clang++ 14.x with the `-ftime-trace` flag, plus the aforemention= ed ClangBuildAnalyzer tool. A few questions: 1. Is this improvement something that the libstdc++ maintainers would wa= nt to merge in? Of course, the changes need to be cleaned up and adapted to= GCC's coding style. 2. If so, what is the easiest way to create a patch in the format that y= ou are used to and test it against libstdc++'s test suite? I have never con= tributed to libstdc++ or GCC before. Thanks. Vittorio Romeo https://vittorioromeo.com