Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v6qQw-00Ae6f-D3 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 13:11:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v6qQu-004ojW-4o for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Oct 2025 13:11:49 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v6qQt-004ojG-9m for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 13:11:48 +0000 Received: from fhigh-a1-smtp.messagingengine.com ([103.168.172.152]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1v6qQr-000rDq-1C for pgsql-hackers@lists.postgresql.org; Thu, 09 Oct 2025 13:11:47 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id 960CB14000C9; Thu, 9 Oct 2025 09:11:44 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Thu, 09 Oct 2025 09:11:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=burd.me; h=cc:cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1760015504; x=1760101904; bh=sJ8sRwTz5hv+AfceQ2pZkrG7BkLbYLXf2iNXLCnTHGM=; b= pPdTFPNSafqAoedKH+VA+rEVJSa5vykoFsGcJGIfUQlMT1zSxbOwVv20LyzCHaOH oyC56b3Lyv2zH7SdSfiRP2c/u2JnfBpTu4JSC9LOgkzqAfgThVlgbsuMikvSShdd peiMj6LGiDzaFU85xpwhzwIRPMyeHOGsxKwadzqzqzXYJp4L23EMf8ct3yo7JS/b GATPsIQdtxVKPKwh+S7Yy+slqXN1UyuOAfiWaPQ65QBBWip1LbkztXoxsw2rxL1D TjtiyaPyG0S4fMYXFs6GV6Qexq96lP814/mI/QNNPpFLna/e/pO2T0vuyThnIr9d JW/L5zhyr0Vzcnp/xeffjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1760015504; x= 1760101904; bh=sJ8sRwTz5hv+AfceQ2pZkrG7BkLbYLXf2iNXLCnTHGM=; b=S AKa0kKuFaDPfm2c9Ltw1V7UH0xkbfjt0neWkMWi9dWEWSgCZsvY55niqxbjNq+nn rpVUCPYdEos6nydSJtynmShQRyw9oqfXl0tHk4w43LHzyE89LsXIwzOp9cG8OI3Z E/nX0YUikGtIhFZZzHepPCqOv5kU7abDTZhapCw8vZjxQNvGNNTN13sJrnPIOzlA BIFEXJV1jKmsv4VgILEwjyauNO6ZzRj+BZvtwSZWd0wjZrpq9dlhUeXyjVIksRB/ ha18wBZyvm3TVr0tOGVPgHntkg35ka48GYAAC7EzujCgc/JZ5unMKS+/P8ZXN1Cx ZTYNpjQMjI6MK6Dss+Siw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddutdeivdeiucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevkfgjfhfuofggtgfgugesthhqmhdtredtjeenucfhrhhomhepifhrvghg uceuuhhrugcuoehgrhgvghessghurhgurdhmvgeqnecuggftrfgrthhtvghrnhepueeiff dugffhvefhvdethfduveegudeigfeiueevteduffetvdegleegudduveelnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepghhrvghgsegsuhhrug drmhgvpdhnsggprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthho pehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghpthhtohepughgrhhofihlvg ihmhhlsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprhgrnhhivghrrdhvfhesghhmrghi lhdrtghomhdprhgtphhtthhopegurghnihgvlheshigvshhqlhdrshgvpdhrtghpthhtoh epphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i675e48f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Oct 2025 09:11:43 -0400 (EDT) Date: Thu, 9 Oct 2025 09:11:43 -0400 From: Greg Burd To: Michael Paquier , David Rowley Cc: Ranier Vilela , Daniel Gustafsson , PostgreSQL Hackers Message-ID: <06A7959F-F0D3-4B2B-ACB0-19114E071B53@getmailspring.com> In-Reply-To: References: Subject: Re: [PATCH] Add tests for Bitmapset X-Mailer: Mailspring MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Oct 8 2025, at 11:47 pm, Michael Paquier wrote= : > On Thu, Oct 09, 2025 at 04:35:55PM +1300, David Rowley wrote: >> On Thu, 9 Oct 2025 at 15:13, Michael Paquier w= rote: >> > What do you think about the attached=3F >> =20 >> Thanks. Looks pretty good. >> =20 >> > + members =3D palloc(sizeof(int) * num=5Fops); >> =20 >> Any reason to pfree that and allocate that to the same size as it >> already was=3F > =20 > No reason. We can shortcut that a bit. > =20 >> Wondering if the =22members=5Bpos=5D =3D members=5B--num=5Fmembers=5D;= =22 is worth a >> short comment. Maybe something like: /* zap this member by moving the >> final array member into its place and shrinking the array by 1 */ > =20 > Yes, a comment can be adapted here. Sounds good to me. > -- > Michael Michael, David, This patch LGTM. I appreciate the additional work you've both put into i= t. You're right, of course, I didn=E2=80=99t need to preserve the order of e= lements when deleting. This is where I'd started and I don't recall why I changed it and didn't revert to this simpler solution. + members=5Bpos=5D =3D members=5B--num=5Fmembers=5D; Phase 2 might record a value to members that was also recorded in phase 1, but that seems harmless. That's why I had: + if (=21bms=5Fis=5Fmember(member, bms1) && =21bms=5Fis=5Fmember(member, = bms2)) I hadn't thought to optimize this function, but given the amount of time the tests run in aggregate globally, it makes sense. best. -greg