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 1pU7vF-0001Jc-Kn for pgsql-committers@arkaria.postgresql.org; Mon, 20 Feb 2023 15:17:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pU7vE-00024Q-HB for pgsql-committers@arkaria.postgresql.org; Mon, 20 Feb 2023 15:17:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU7vE-00024H-9m for pgsql-committers@lists.postgresql.org; Mon, 20 Feb 2023 15:17:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pU7vC-0006to-6R; Mon, 20 Feb 2023 15:17:43 +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 31KFHfc53567482; Mon, 20 Feb 2023 10:17:41 -0500 From: Tom Lane To: John Naylor cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Add assert checking to pg_leftmost_one_pos32() and friends In-reply-to: References: Comments: In-reply-to John Naylor message dated "Mon, 20 Feb 2023 07:33:55 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3567480.1676906261.1@sss.pgh.pa.us> Date: Mon, 20 Feb 2023 10:17:41 -0500 Message-ID: <3567481.1676906261@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk John Naylor writes: > Add assert checking to pg_leftmost_one_pos32() and friends I can see that this was worth writing for testing purposes, but is it really worth carrying permanently? Even in a debug build, the ratio of cycles expended to chances of finding a problem seems mighty poor, and you've done a lot of damage to the readability of these functions too. Maybe we could condition the duplicate computation on some additional not-commonly-defined macro? That'd do little for the readability issue though. regards, tom lane