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 1oKqcK-0005qa-Qp for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Aug 2022 00:27: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 1oKqcJ-0002j7-52 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Aug 2022 00:27:35 +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 1oKqcI-0002ix-Rr for pgsql-hackers@lists.postgresql.org; Mon, 08 Aug 2022 00:27:34 +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 1oKqcG-000326-Iw for pgsql-hackers@postgresql.org; Mon, 08 Aug 2022 00:27:33 +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 2780RReD295420; Sun, 7 Aug 2022 20:27:27 -0400 From: Tom Lane To: Thomas Munro cc: Andres Freund , Andrew Dunstan , Robert Haas , pgsql-hackers Subject: Re: Cleaning up historical portability baggage In-reply-to: References: <20220712173352.trdeq66asbv6vf2q@awork3.anarazel.de> <1662559.1657648462@sss.pgh.pa.us> <1249825.1658622186@sss.pgh.pa.us> <20220804034343.unm4rdynedbigamv@awork3.anarazel.de> <3322724.1659586159@sss.pgh.pa.us> Comments: In-reply-to Thomas Munro message dated "Thu, 04 Aug 2022 16:18:40 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <295418.1659918447.1@sss.pgh.pa.us> Date: Sun, 07 Aug 2022 20:27:27 -0400 Message-ID: <295419.1659918447@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thomas Munro writes: > On Thu, Aug 4, 2022 at 4:09 PM Tom Lane wrote: >> clock_gettime is required by SUSv2 (1997), so I have to admit that >> macOS 10.4 doesn't have a lot of excuse not to have it. In any case, >> prairiedog is just sitting there doing its thing until I find cycles >> to install a newer OS. If you want to move ahead with this, don't >> let prairiedog block you. > Thanks, will do. BTW, that commit really should have updated the explanation at the top of instr_time.h: * This file provides an abstraction layer to hide portability issues in * interval timing. On Unix we use clock_gettime() if available, else * gettimeofday(). On Windows, gettimeofday() gives a low-precision result * so we must use QueryPerformanceCounter() instead. These macros also give * some breathing room to use other high-precision-timing APIs. Updating the second sentence is easy enough, but as for the third, I wonder if it's still true in view of 24c3ce8f1. Should we revisit whether to use gettimeofday vs. QueryPerformanceCounter? At the very least I suspect it's no longer about "low precision", but about which API is faster. regards, tom lane