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 1pw6Jf-0008MD-TZ for pgsql-hackers@arkaria.postgresql.org; Mon, 08 May 2023 19:14:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pw6Je-0004P9-UD for pgsql-hackers@arkaria.postgresql.org; Mon, 08 May 2023 19:14:34 +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 1pw6Gc-0007rv-7K for pgsql-hackers@lists.postgresql.org; Mon, 08 May 2023 19:11:27 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pw6GY-001FhI-0b for pgsql-hackers@lists.postgresql.org; Mon, 08 May 2023 19:11:25 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 978F65C00B3; Mon, 8 May 2023 15:11:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 08 May 2023 15:11:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1683573079; x=1683659479; bh=ho 2V8TDWbAnpZB4/VB3+1dRMIsmXby9eLfAC1/w7SgY=; b=mbkIiAsA7et3qq6OrG FeqwNgaiJ5A9BSefVj0n0CfTqxp/+46FwrQmAz90RQ0W+FABDAZ7s18k63BUGNRz +PwrQx3iQpgsG+gb9SYn9MsDInihYOzSYJq+l7Eh5eWlZqT54iETZ+1WcQplzURk wiGd2VeGD97kgKxtKFzkhFuK4x29mTDj8NQN7IxULf1qqkk9N7h25RLT/ZOYiPEx s+oPok0zUjT0b+EymaWVvbKyry/ZXSp4K5hcQPYAU1PTJoGNwypR/6ScPRVAR2Gr y6r+I3+NmODJ03CUcxOem9VDCo2K4TO9cUR7ixSVAYDQ0ORUuzUC3/ak1HYycPzS abDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1683573079; x=1683659479; bh=ho2V8TDWbAnpZ B4/VB3+1dRMIsmXby9eLfAC1/w7SgY=; b=JuwWKE2CTFOpn5zpUdSrKSqiBBALx QmoNin08JFQ5tSGRndgVrpOJ9AysCiPRsINjt5f3qFC/puz5hQAsBgxkttAbx72P faWlcf5dRT0FBhlvIp9gpb8qBFtgn3m1ftPzk9k56Oe7ttxDu56qgVhDPBoi/Ami eAbU015tErrfXvxpeQjXV3iqm5nHpR1c1sliHzPTh/nxGqaK6VIrejB4LYbW2SAr gvsMStIj8zQqYyyM3qlCnvXU5JCRtOaL+9mEWnomA1N6pTIhv+xoiDvZgFITOZ55 5CWj4AkOwVN8UtRYUonbE6MSifAdYMBbVMBiiy+7K/OwWyrZAjExTMNtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefkedgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucggtf frrghtthgvrhhnpedvffefvefhteevffegieetfefhtddvffejvefhueetgeeludehteev udeitedtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhroh hmpegrnhgurhgvshesrghnrghrrgiivghlrdguvg X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 8 May 2023 15:11:19 -0400 (EDT) Date: Mon, 8 May 2023 12:11:17 -0700 From: Andres Freund To: Alexander Lakhin , Michael Paquier Cc: MARK CALLAGHAN , pgsql-hackers@lists.postgresql.org Subject: Re: benchmark results comparing versions 15.2 and 16 Message-ID: <20230508191117.v6475ip6hxpwukss@awork3.anarazel.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-05-08 16:00:01 +0300, Alexander Lakhin wrote: > This difference is confirmed by multiple test runs. `git bisect` for this > regression pointed at f193883fc. I can reproduce a significant regression due to f193883fc of a workload just running SELECT CURRENT_TIMESTAMP; A single session running it on my workstation via pgbench -Mprepared gets before: tps = 89359.128359 (without initial connection time) after: tps = 83843.585152 (without initial connection time) Obviously this is an extreme workload, but that nevertheless seems too large to just accept... Michael, the commit message notes that there were no measured performance regression - yet I see one in a trivial test. What were you measuring? I'm a bit surprised by the magnitude of the regression, but it's not surprising that there is a performance effect. You're replacing something that doesn't go through the whole generic function rigamarole, and replace it with something that does... Looking at two perf profiles, the biggest noticable difference is Before: - 5.51% 0.13% postgres postgres [.] ExecInitResult - 5.38% ExecInitResult + 2.29% ExecInitResultTupleSlotTL - 2.22% ExecAssignProjectionInfo - 2.19% ExecBuildProjectionInfo 0.47% ExecReadyInterpretedExpr - 0.43% ExecInitExprRec - 0.10% palloc AllocSetAlloc.localalias (inlined) + 0.32% expression_tree_walker_impl.localalias (inlined) + 0.28% get_typlen 0.09% ExecPushExprSlots + 0.06% MemoryContextAllocZeroAligned + 0.04% MemoryContextAllocZeroAligned 0.02% exprType.localalias (inlined) + 0.41% ExecAssignExprContext + 0.35% MemoryContextAllocZeroAligned 0.11% ExecInitQual.localalias (inlined) + 0.11% _start + 0.02% 0x55b89c764d7f After: - 6.57% 0.17% postgres postgres [.] ExecInitResult - 6.40% ExecInitResult - 3.00% ExecAssignProjectionInfo - ExecBuildProjectionInfo - 0.91% ExecInitExprRec - 0.65% ExecInitFunc 0.23% fmgr_info_cxt_security + 0.18% palloc0 + 0.07% object_aclcheck 0.04% fmgr_info 0.05% check_stack_depth + 0.05% palloc + 0.58% expression_tree_walker_impl.localalias (inlined) + 0.55% get_typlen 0.37% ExecReadyInterpretedExpr + 0.11% MemoryContextAllocZeroAligned 0.09% ExecPushExprSlots 0.04% exprType.localalias (inlined) + 2.77% ExecInitResultTupleSlotTL + 0.50% ExecAssignExprContext + 0.09% MemoryContextAllocZeroAligned 0.05% ExecInitQual.localalias (inlined) + 0.10% _start I.e. we spend more time building the expression state for expression evaluation, because we now go through the generic ExecInitFunc(), instead of something dedicated. We also now need to do permission checking etc. I don't think that's the entirety of the regression... Greetings, Andres Freund