pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: gettimeofday is at the end of its usefulness?
Date: Fri, 13 Jan 2017 21:48:51 +0100
Message-ID: <87wpdy1ya4.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <4130.1483045351@sss.pgh.pa.us>
References: <31856.1400021891@sss.pgh.pa.us>
	<20140515185614.GG25053@momjian.us>
	<CAA-aLv7m=RU0vKm1myt_uRLYmTviqFcfWZCMPwbXdbKoX4YzYg@mail.gmail.com>
	<20237.1465397783@sss.pgh.pa.us>
	<CAJrrPGd2rA6UoPOxUK1WRgKfxRYB7vQZ357zCv+6kx3ced7v4g@mail.gmail.com>
	<CAJrrPGecetyS5m1F8v4jOUFqy0zGr7hR8kgDMiq1HWeOKB3_oA@mail.gmail.com>
	<15740.1482788055@sss.pgh.pa.us>
	<87y3yyfqqe.fsf@mid.deneb.enyo.de>
	<4130.1483045351@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

* Tom Lane:

> Florian Weimer <fw@deneb.enyo.de> writes:
>> * Tom Lane:
>>> On Linux (RHEL6, 2.4GHz x86_64), I find that gettimeofday(),
>>> clock_gettime(CLOCK_MONOTONIC), and clock_gettime(CLOCK_REALTIME)
>>> all take about 40ns.  Of course gettimeofday() only has 1us resolution,
>>> but the other two have perhaps 10ns resolution (I get no duplicate
>>> readings in a tight loop).
>
>> Isn't this very specific to kernel and glibc versions, depending on
>> things like CONFIG_HZ settings and what level of vDSO support has been
>> backported?
>
> No doubt, but I have yet to find a platform where clock_gettime() exists
> but performs worse than gettimeofday().  Do you know of one?

ppc64le with all the vDSO fixes for clock_gettime?

glibc has some test cases which fail because clock_gettime gives
inconsistent results.  This has been fixed in current kernels, but I
don't know if everyone uses them.


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (34+ messages)  latest in thread

Message-ID: <87wpdy1ya4.fsf@mid.deneb.enyo.de>
Permalink:  ../87wpdy1ya4.fsf@mid.deneb.enyo.de/
Also on:    postgresql.org/message-id/87wpdy1ya4.fsf@mid.deneb.enyo.de

 · 

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: fw@deneb.enyo.de, tgl@sss.pgh.pa.us, kommi.haribabu@gmail.com
  Subject: Re: gettimeofday is at the end of its usefulness?
  In-Reply-To: <87wpdy1ya4.fsf@mid.deneb.enyo.de>

* 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