This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 05/10] Use clock_gettime to implement time.
- From: Zack Weinberg <zackw at panix dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Joseph Myers <joseph at codesourcery dot com>, Lukasz Majewski <lukma at denx dot de>, Alistair Francis <alistair23 at gmail dot com>, Stepan Golosunov <stepan at golosunov dot pp dot ru>, Arnd Bergmann <arnd at arndb dot de>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Samuel Thibault <samuel dot thibault at ens-lyon dot org>
- Date: Wed, 28 Aug 2019 14:36:08 -0400
- Subject: Re: [PATCH v2 05/10] Use clock_gettime to implement time.
- References: <20190828153236.18229-1-zackw@panix.com> <20190828153236.18229-6-zackw@panix.com> <87muftb1fk.fsf@oldenburg2.str.redhat.com>
On Wed, Aug 28, 2019 at 2:16 PM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Zack Weinberg:
>
> > Most ports were using gettimeofday to implement time, or they were
> > making a direct (v)syscall. Unconditionally switch to using
> > clock_gettime instead. All sysdeps implementations of time are
> > removed.
>
> I'm sorry, but this is clearly not advisable because clock_gettime is
> almost an order of magnitude slower than time.
Hmm. How do we reconcile this with the (Linux) kernel maintainers'
stated intentions to provide only clock_gettime in the future? We
could use CLOCK_REALTIME_COARSE when available, I suppose; can you see
whether that recovers the lost performance, or else send me your
benchmark code so I can try it?
zw