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 1mHt4W-0000nE-5z for pgsql-performance@arkaria.postgresql.org; Sun, 22 Aug 2021 19:23:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mHt4U-0005U0-Ob for pgsql-performance@arkaria.postgresql.org; Sun, 22 Aug 2021 19:23:54 +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 1mHt4U-0005Ts-GS for pgsql-performance@lists.postgresql.org; Sun, 22 Aug 2021 19:23:54 +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 1mHt4O-0005p4-Et for pgsql-performance@postgresql.org; Sun, 22 Aug 2021 19:23:53 +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 17MJNhRh035730; Sun, 22 Aug 2021 15:23:43 -0400 From: Tom Lane To: "ldh@laurent-hasson.com" cc: Justin Pryzby , Ranier Vilela , "pgsql-performance@postgresql.org" Subject: Re: Big Performance drop of Exceptions in UDFs between V11.2 and 13.4 In-reply-to: References: <2092859.1629558281@sss.pgh.pa.us> <2136207.1629569846@sss.pgh.pa.us> <20210821191950.GW10479@telsasoft.com> <20210821221729.GY10479@telsasoft.com> <20210822154758.GZ10479@telsasoft.com> <30496.1629654632@sss.pgh.pa.us> Comments: In-reply-to "ldh@laurent-hasson.com" message dated "Sun, 22 Aug 2021 19:07:43 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <35728.1629660223.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 22 Aug 2021 15:23:43 -0400 Message-ID: <35729.1629660223@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "ldh@laurent-hasson.com" writes: > So, now, in summary: > - I have tried V13.4, V12.3, 11.13, 11.2, 11.1 on several Windows VMs an= d my personal laptop (no VM). > - All V11.x seem to behave uniformly. > - Starting with 12.3, I am experiencing the major slowdown in the "with = exceptions" scenario. Interesting. There's no meaningful difference between v11 and v12 as far as timeout handling goes, so I'm starting to think that that's a red herring. (Although, after having done some web-searching, I do wonder why timer.c is using a manual-reset event. It looks like auto-reset would work just as well with less code, and I found some suggestions that it might perform better.) > So, I was thinking about stuff and a lot of your intuitions seem to driv= e towards an issue with the compiler used to compile the Winx64 version...= But is it possible that the JIT is getting in there and making things wei= rd? Given that it's a major change in V12 and this is when I am starting t= o see the issue popup, I figured it might be another avenue to look into? Hm, is JIT even enabled in your build? If so, does setting jit =3D 0 change anything? regards, tom lane