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

Improve performance of NamespaceString

    • Service Arch
    • Fully Compatible
    • Service Arch 2023-12-11, Service Arch 2024-01-22, Service Arch 2024-02-05, Service Arch 2024-02-19, Service Arch 2024-03-04
    • 171

      The NamespaceString::ConstantProxy and DatabaseName::ConstantProxy classes currently uses std::call_once to provide access to a NamespaceString object; this is done on every access to the NamespaceString constants. Since std::call_once must do atomic operations, it is fairly expensive, and adds several hundred nanoseconds to opObserver calls just to check that an opObserver shouldn't run.

      Additionally, before we had tenantId, getting the database for a NamespaceString was a cheap operation that just got a reference; it now requires a copy. Ideally we would have a DatabaseNameRef class that could be used almost anyplace a DatabaseName is, with DatabaseName reserved for when we need to actually store one.

            Assignee:
            didier.nadeau@mongodb.com Didier Nadeau
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: