Re: What is a typical precision of gettimeofday()? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: What is a typical precision of gettimeofday()?
Date
Msg-id 3120723.1719945221@sss.pgh.pa.us
Whole thread Raw
In response to Re: What is a typical precision of gettimeofday()?  (Hannu Krosing <hannuk@google.com>)
List pgsql-hackers
Hannu Krosing <hannuk@google.com> writes:
> At least "does it run" tests should be there -

> For example with the current toolchain on MacOS I was able to compile
> __builtin_readcyclecounter(); but it crashed when the result was
> executed.

> The same code compiled *and run* fine on same laptop with Ubuntu 24.04

> We might also want to have some testing about available speedups from
> pg_bitmanip.h being used, but that could be tricky to test in an
> universal way.

Keep in mind that pg_test_timing is not just some random exercise in a
vacuum.  The point of it IMV is to provide data about the performance
one can expect from the instr_time.h infrastructure, which bears on
what kind of resolution EXPLAIN ANALYZE and other features have.  So
if we did want to depend on read_tsc() or __builtin_readcyclecounter()
or what-have-you, the way to go about it would be to change
instr_time.h to compile code that uses that.  I would consider that
to be a separate patch from what we're doing to pg_test_timing here.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: What is a typical precision of gettimeofday()?
Next
From: Tom Lane
Date:
Subject: Re: On disable_cost