Hi, On 2023-01-13 15:25:16 -0500, Tom Lane wrote: > Andres Freund <and...@anarazel.de> writes: > > Does anybody see a reason to not move forward with this aspect? We do a fair > > amount of INSTR_TIME_ACCUM_DIFF() etc, and that gets a good bit cheaper by > > just using nanoseconds. > > Cheaper, and perhaps more accurate too? Don't recall if we have any code > paths where the input timestamps are likely to be better-than-microsecond, > but surely that's coming someday.
instr_time on !WIN32 use struct timespec, so we already should have nanosecond precision available. IOW, we could add a INSTR_TIME_GET_NANOSEC today. Or am I misunderstanding what you mean? > I'm unsure that we want to deal with rdtsc's vagaries in general, but > no objection to changing instr_time. Cool. Looking at the instr_time.h part of the change, I think it should go further, and basically do the same thing in the WIN32 path. The only part that needs to be be win32 specific is INSTR_TIME_SET_CURRENT(). That'd reduce duplication a good bit. Greetings, Andres Freund