pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Cleaning up historical portability baggage
Date: Mon, 08 Aug 2022 19:46:00 -0400
Message-ID: <747620.1660002360@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+hUKGK=N8W2uFPdJr07Rs4dgRtbzKaYvCaPQasX3S8=aTO5PQ@mail.gmail.com>
References: <CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com>
	<CA+Tgmoazusui5EoU_7Z=AgwC5pTAqDndTa7d-owjvQwG3zoRhg@mail.gmail.com>
	<CA+hUKGLLJUMDgCzOK5K4NE6PpU87Ka7t7RQsZoZAZ_EKfL5L+A@mail.gmail.com>
	<CA+Tgmoaw6VBC9Xzr4vOaC0kc-94jb9nzH8MY38Gqn7=wy=i_3w@mail.gmail.com>
	<20220712173352.trdeq66asbv6vf2q@awork3.anarazel.de>
	<1662559.1657648462@sss.pgh.pa.us>
	<CA+hUKG+MOzmDkr27ceG8+uwgFxbJUUv699V3VP3DCioQigrf7A@mail.gmail.com>
	<1249825.1658622186@sss.pgh.pa.us>
	<CA+hUKGLryBW4fNYoXzMG9y1e0H-QOTdSiTG46xCr1DNuuPwbeg@mail.gmail.com>
	<CA+hUKGJMcwbzRyfTocfxbPBUhERqKE42d-L22jQ+vpB7an-NjQ@mail.gmail.com>
	<20220804034343.unm4rdynedbigamv@awork3.anarazel.de>
	<3322724.1659586159@sss.pgh.pa.us>
	<CA+hUKGJ5ej33AJL19sQph7Z8SFZ6+aUSKxFTS6pvk2Y8J9Tcwg@mail.gmail.com>
	<295419.1659918447@sss.pgh.pa.us>
	<CA+hUKGK=N8W2uFPdJr07Rs4dgRtbzKaYvCaPQasX3S8=aTO5PQ@mail.gmail.com>

Thomas Munro <thomas.munro@gmail.com> writes:
> Yeah, that's not true anymore, and QueryPerformanceCounter() is faster
> than Get­System­Time­Precise­As­File­Time()[1], but there doesn't
> really seem to be any point in mentioning that or gettimeofday() at
> all here.  I propose to cut it down to just:

>   * 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.
> + * interval timing.  On Unix we use clock_gettime(), and on Windows we use
> + * QueryPerformanceCounter().  These macros also give some breathing room to
> + * use other high-precision-timing APIs.

WFM.

> FWIW I expect this stuff to get whacked around some more for v16[2].
> [2] https://commitfest.postgresql.org/39/3751/

Meh.  I think trying to use rdtsc is a fool's errand; you'll be fighting
CPU quirks forever.

			regards, tom lane





view thread (108+ messages)  latest in thread

Message-ID: <747620.1660002360@sss.pgh.pa.us>
Permalink:  ../747620.1660002360@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/747620.1660002360@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, thomas.munro@gmail.com, andres@anarazel.de, andrew@dunslane.net, robertmhaas@gmail.com
  Subject: Re: Cleaning up historical portability baggage
  In-Reply-To: <747620.1660002360@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox