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 1oSxPb-0004Cu-Ow for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 09:19:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oSxPa-0005m0-If for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Aug 2022 09:19:58 +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 1oSxPa-0005lk-9e for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 09:19:58 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oSxPX-0008W2-QS for pgsql-hackers@lists.postgresql.org; Tue, 30 Aug 2022 09:19:57 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E56615C01AF; Tue, 30 Aug 2022 05:19:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 30 Aug 2022 05:19:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1661851194; x=1661937594; bh=g 1DihebCfiYfR4TEBeEI84Yx/3B+5cIFGVfQfNn6D18=; b=aHw0h3leHl1gTbWip XmHRsIwxYlUqD70zegZjQjiIkX8lVTB9vPkLz8J4/NQDzp4CpCbpJAPFUSw75Xkf h2/YpRCGxBu7/nDcs/jGPNyjNbb50jz39UxJoZdAs1t/S9HbZeU7p1wYeXD8zDv3 TtA2X9HCZDDtn6QwYXBHCjJl7JOGvbfR85Y2kb8nXAC7wvgUprgjBPDudcbHzAZP Sv0ss1eyDKZeKNBIPeaS/c2zYxOEOUlnWbYI52Vk6tPpXCOb26ORrs8QKVwqVEc4 Q918u3xQRjfHOrNfDroVuBR//N3eEgW0v9Ks55gogQZpMOkyh3efZSMC2TNJbAYz 8whIw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdekfedgudehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffhjeejhffgieeuueekjeek fffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomh enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhv hhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 30 Aug 2022 05:19:53 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id F41AF378; Tue, 30 Aug 2022 11:20:08 +0200 (CEST) Date: Tue, 30 Aug 2022 11:20:08 +0200 From: Alvaro Herrera To: Amit Langote Cc: Nikita Glukhov , Andrew Dunstan , "Jonathan S. Katz" , Tom Lane , Robert Haas , Andres Freund , PostgreSQL Hackers , Michael Paquier , John Naylor Subject: Re: SQL/JSON features for v15 Message-ID: <20220830092008.6dbublx6la226zis@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2022-Aug-30, Amit Langote wrote: > Patches 0001-0006: > > Yeah, these add the overhead of an extra function call (typin() -> > typin_opt_error()) in possibly very common paths. Other than > refactoring *all* places that call typin() to use the new API, the > only other option seems to be to leave the typin() functions alone and > duplicate their code in typin_opt_error() versions for all the types > that this patch cares about. Though maybe, that's not necessarily a > better compromise than accepting the extra function call overhead. I think another possibility is to create a static inline function in the corresponding .c module (say boolin_impl() in bool.c), which is called by both the opt_error variant as well as the regular one. This would avoid the duplicate code as well as the added function-call overhead. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ Syntax error: function hell() needs an argument. Please choose what hell you want to involve.