From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@enterprisedb.com>
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: Thu, 29 Dec 2016 16:18:42 -0500
Message-ID: <4685.1483046322@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEepm=11a1_eYHt4ET_LpgUsuCkzX=dqmCXBkY8ed1=uhZe8mA@mail.gmail.com>
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>
<CAEepm=11a1_eYHt4ET_LpgUsuCkzX=dqmCXBkY8ed1=uhZe8mA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Thomas Munro <thomas.munro@enterprisedb.com> writes:
> On Tue, Dec 27, 2016 at 10:34 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> However, it seems that these impressive results date back only to
>> June 2012, cf
>> https://github.com/freebsd/freebsd/commit/13a9f42818f6b89a72b3e40923be809b490400d8
>> and at least as of that commit, only x86 and x86_64 had the fast
>> clock_gettime code. Older FreeBSD, or FreeBSD on another architecture,
>> is likely to be a lot worse. But I lack an installation to try.
> That commit is in every 'production' and 'legacy' release of
> FreeBSD[1], meaning as far back as 9.3 (expected to be EoL in the next
> few days), because it landed in 9.2 (EoL).
I'm unclear on whether there's any significant number of people running
out-of-support *BSD releases. If it's not something we have to worry
about, fine.
> That leaves the following architectures without
> fast-path time functions:
> macaque:freebsd munro$ git grep 'trivial-vdso_tc.c'
> lib/libc/mips/sys/Makefile.inc:SRCS+= trivial-vdso_tc.c
> lib/libc/powerpc/Makefile.inc:SRCS+= trivial-vdso_tc.c
> lib/libc/powerpc64/Makefile.inc:SRCS+= trivial-vdso_tc.c
> lib/libc/powerpcspe/Makefile.inc:SRCS+= trivial-vdso_tc.c
> lib/libc/riscv/sys/Makefile.inc:SRCS+= trivial-vdso_tc.c
> lib/libc/sparc64/Makefile.inc:SRCS+= trivial-vdso_tc.c
Yeah, I just finished getting results from FreeBSD 10.3 on PPC
(1.33GHz G4 laptop): gettimeofday takes about 1180 ns and clock_gettime
about 1200 ns. That difference seems to be repeatable, but since it's
only 2% I'm not too fussed about it. Interestingly, it's very easy
to tell that it is entering the kernel, because time(1) shows a
significant fraction of system time:
$ time ./testclock
0 bogus readings
100000000 distinct readings
117.96 real 26.80 user 90.31 sys
The same test on platforms with vDSO support shows zero system time.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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@enterprisedb.com, kommi.haribabu@gmail.com
Subject: Re: gettimeofday is at the end of its usefulness?
In-Reply-To: <4685.1483046322@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