• filipe oliveira's avatar
    Optimization: Use either monotonic or wall-clock to measure command execution... · 3cd8baf6
    filipe oliveira authored
    
    Optimization: Use either monotonic or wall-clock to measure command execution time, to regain up to 4% execution time (#10502)
    
    In #7491 (part of redis 6.2), we started using the monotonic timer instead of mstime to measure
    command execution time for stats, apparently this meant sampling the clock 3 times per command
    rather than two (wince we also need the wall-clock time).
    In some cases this causes a significant overhead.
    
    This PR fixes that by avoiding the use of monotonic timer, except for the cases were we know it
    should be extremely fast.
    This PR also adds a new INFO field called `monotonic_clock` that shows which clock redis is using.
    Co-authored-by: default avatarOran Agra <oran@redislabs.com>
    3cd8baf6
monotonic.h 2.16 KB