back in redis/redis#7644 we introduced more efficient monotonic time tracking
which avoid using the clock_gettime posix which is running a vDSO syscall.
The expected improvements is expected to be ~x3 times faster time access (reduction from ~100ns to 10-30ns). However, we never set this config to be the default as stated in the code:
/* Using the processor clock (aka TSC on x86) can provide improved performance
* throughout the server wherever the monotonic clock is used. The processor clock
* is significantly faster than calling 'clock_gettime' (POSIX). While this is
* generally safe on modern systems, this link provides additional information
* about use of the x86 TSC: http://oliveryang.net/2015/09/pitfalls-of-TSC-usage
*
* To use the processor clock, either uncomment this line, or build with
* CFLAGS="-DUSE_PROCESSOR_CLOCK"
* #define USE_PROCESSOR_CLOCK
The proposal here is to change the default compilation define to true (in case the CPU supports these instructions). we can avoid the CPU support testing during compile time as it is verified during the initialization of the clocks.
back in redis/redis#7644 we introduced more efficient monotonic time tracking
which avoid using the clock_gettime posix which is running a vDSO syscall.
The expected improvements is expected to be ~x3 times faster time access (reduction from ~100ns to 10-30ns). However, we never set this config to be the default as stated in the code:
The proposal here is to change the default compilation define to true (in case the CPU supports these instructions). we can avoid the CPU support testing during compile time as it is verified during the initialization of the clocks.