Performance experiment: Use fetchAndAddRelaxed for Mutex diagnostic counters

XMLWordPrintableJSON

    • Type: Engineering Test
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch 2023-04-17, Service Arch 2023-05-01
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      During the BF-28130 performance investigation, we noticed that approximately 3.1% of execution time is spent inside Mutex::_onQuickLock, Mutex::_onUnlock, and similar methods. These functions don't actually perform any locking or unlocking, they just increment the counters used for latch analysis and call diagnostic listeners. The counters are only written to in these methods, using fetchAndAdd(), and they're only read in one place in code (inside LatchAnalyzer) using loadRelaxed().

      The goal of this ticket is to do preliminary performance testing to check whether replacing these fetchAndAdd() calls with fetchAndAddRelaxed() would yield any performance improvements.

        1. image-2023-04-17-01-11-58-554.png
          image-2023-04-17-01-11-58-554.png
          47 kB
        2. SERVER-75867.csv
          12 kB
        3. SERVER-75867-diff
          2 kB

            Assignee:
            Alex Li
            Reporter:
            Vojislav Stojkovic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: