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 1rTTRi-003JNc-AA for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 21:09:06 +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 1rTTRg-002SH8-CJ for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jan 2024 21:09:04 +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 1rTTRg-002SH0-2x for pgsql-hackers@lists.postgresql.org; Fri, 26 Jan 2024 21:09:04 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rTTRd-003X7B-Ly for pgsql-hackers@postgresql.org; Fri, 26 Jan 2024 21:09:02 +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 40QL903Q1113189; Fri, 26 Jan 2024 16:09:00 -0500 From: Tom Lane To: David Rowley cc: Richard Guo , PostgreSQL-development Subject: Re: A performance issue with Memoize In-reply-to: References: <422277.1706207562@sss.pgh.pa.us> <1035225.1706301718@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Sat, 27 Jan 2024 10:02:51 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1113187.1706303340.1@sss.pgh.pa.us> Date: Fri, 26 Jan 2024 16:09:00 -0500 Message-ID: <1113188.1706303340@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > On Sat, 27 Jan 2024 at 09:41, Tom Lane wrote: >> drongo and fairywren are consistently failing the test case added >> by this commit. I'm not quite sure why the behavior of Memoize >> would be platform-specific when we're dealing with integers, >> but ... > Maybe snprintf(buf, "%.*f", 0, 5.0 / 2.0); results in "3" on those > rather than "2"? > Looking at the code in fmtfloat(), we fallback on the built-in snprintf. Maybe ... I don't have a better theory. > I can try changing the unique1 < 5 to unique1 < 4 to see that's more stable. Worth a try. regards, tom lane