Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohyJy-0007U1-RG for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Oct 2022 19:20:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ohyJx-00063S-N4 for pgsql-hackers@arkaria.postgresql.org; Mon, 10 Oct 2022 19:20:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohyJx-000628-Dk for pgsql-hackers@lists.postgresql.org; Mon, 10 Oct 2022 19:20:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ohyJv-0000Xq-2t for pgsql-hackers@lists.postgresql.org; Mon, 10 Oct 2022 19:20:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29AJK8lt140402; Mon, 10 Oct 2022 15:20:08 -0400 From: Tom Lane To: Nathan Bossart cc: pgsql-hackers@lists.postgresql.org Subject: Re: Simplifying our Trap/Assert infrastructure In-reply-to: <20221009212937.GC900071@nathanxps13> References: <3928703.1665345117@sss.pgh.pa.us> <20221009210148.GA900071@nathanxps13> <3943009.1665349719@sss.pgh.pa.us> <20221009212937.GC900071@nathanxps13> Comments: In-reply-to Nathan Bossart message dated "Sun, 09 Oct 2022 14:29:37 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <140400.1665429608.1@sss.pgh.pa.us> Date: Mon, 10 Oct 2022 15:20:08 -0400 Message-ID: <140401.1665429608@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Nathan Bossart writes: > On Sun, Oct 09, 2022 at 05:08:39PM -0400, Tom Lane wrote: >> Something I thought about but forgot to mention in the initial email: >> is it worth sprinkling these macros with "unlikely()"? > I don't see why not. I experimented with that, and found something that surprised me: there's a noticeable code-bloat effect. With the patch as given, $ size src/backend/postgres text data bss dec hex filename 9001199 86280 204496 9291975 8dc8c7 src/backend/postgres but with unlikely(), $ size src/backend/postgres text data bss dec hex filename 9035423 86280 204496 9326199 8e4e77 src/backend/postgres I don't quite understand why that's happening, but it seems to show that this requires some investigation of its own. So for now I just pushed the patch as-is. regards, tom lane