> Based on Robert's suggestion I wanted to add a "fast_clock_source" enum
> GUC which can have the following values "auto", "rdtsc", "try_rdtsc" and
> "off". With that, at least no additional checks are needed and
> performance will remain as previously benchmarked in this thread.
The attached patch set is rebased on latest master and contains a commit
which adds a "fast_clock_source" GUC that can be "try", "off" and
"rdtsc" on Linux.
Alternatively, we could call the GUC "clock_source" with "auto",
"clock_gettime" and "rdtsc". Opinions?
I moved the call to INSTR_TIME_INITIALIZE() from InitPostgres() to
PostmasterMain(). In InitPostgres() it kept the database in a recovery
cycle.
> I'll still add unlikely() around the if (has_rdtsc).
Done.
--
David Geier