Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-77348

NamespaceStringOrUUID forces unnecessary allocations and copies

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc6
    • Affects Version/s: None
    • Component/s: None
    • None
    • Serverless
    • Fully Compatible
    • v7.0

      The nss() function forces callers to always make a copy of the Namespace string. NamespaceString checks are not uncommon, so the cost of these small memory allocations can add up over time.

      We should just use a raw pointer or return an optional reference to the underlying NSS.

      The specific function call that I saw show up when profiling was this isSystemDotProfile function call, which is in our hot write path on the primary.

            Assignee:
            matt.broadstone@mongodb.com Matt Broadstone
            Reporter:
            louis.williams@mongodb.com Louis Williams
            Votes:
            0 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: