Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster (almost 2x) mutexes (was slower due to ThreadFuzzer) #60823

Merged
merged 1 commit into from
Mar 5, 2024

Commits on Mar 4, 2024

  1. Faster (almost 2x) mutexes (was slower due to ThreadFuzzer)

    Recently I noticed that DB::injection() pops up in perf top, so let's
    optimize it slightly:
    - Add -fomit-frame-pointer -momit-leaf-frame-pointer explicitly --
      almost 0 effect
    - Add ALWAYS_INLINE for ThreadFuzzer::isStarted() (just in case)
    - Disable ThreadFuzzer if non of env variables had been set, this is
      needed to avoid extra checks in DB::injection()
    - Add ALWAYS_INLINE for ThreadFuzzer::injection()
    
    And here are some results for ThreadFuzzer test:
    - before:   elapsed 6.27368 / test time 654 ms
    - after:    elapsed 3.14167 / test time 325 ms
    - disabled: elapsed 2.46666 / test time 263 ms
    
    *But note, it is still slower then with ThreadFuzzer disabled.*
    
    Note, that this numbers for AMD 5975WX, for server with 2x Xeon Silver
    4216 2.10:
    - before:   elapsed 12.109  / test time 1325 ms
    - after:    elapsed 10.506  / test time 1101 ms
    - disabled: elapsed 8.41043 / test time 917 ms
    
    P.S. I've also tried with the same glibc version as server had - zero
    changes.
    
    Refs: https://gist.github.com/azat/51a5fcc3a40af9f678906a3a6e14e079
    Signed-off-by: Azat Khuzhin <[email protected]>
    azat committed Mar 4, 2024
    Configuration menu
    Copy the full SHA
    d5825ec View commit details
    Browse the repository at this point in the history