Details

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • QE 2023-05-15
    • 30

    Description

      LockStats has a function called reset() which resets its counters to zero. These are all atomic sets, so they're not trivially cheap. LockStats unnecessarily calls reset() in both the constructor and the destructor. These are both called with every OperationContext's lifetime, so it's a pretty hot path.

      The constructor doesn't need to call reset() because it can construct the atomics with an initial value of 0 instead. Initial values are not set atomically, which makes them cheaper.

      The destructor doesn't need to call reset() because the object is in the process of being destroyed. This was probably a copy/paste mistake.

      Attachments

        Activity

          People

            colin.stolley@mongodb.com Colin Stolley
            colin.stolley@mongodb.com Colin Stolley
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: