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

Optimize NamespaceString construction in authorization path

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.1.0-rc0, 7.0.0-rc1
    • None
    • None
    • None
    • Fully Compatible
    • v7.0
    • Server Serverless 2023-05-15, Server Serverless 2023-05-29

    Description

      When inspecting a recent flamegraph, we observed a decent amount of time spent in authorization and in particular in NamespaceStringUtil for parsing tenant ids for requests. A few optimizations came to mind:

      • Don't combine dbName and collectionName into a string, just to split it later when building a NamespaceString.
      • Alternatively, skip parsing completely in all paths if multitenancy is not enabled
      • Provide optimized constructors for both NamespaceString(DatabaseName, StringData) and NamespaceString(boost::optional<TenantId>, StringData, StringData) to avoid any unnecessary allocations

      Attachments

        Activity

          People

            matt.broadstone@mongodb.com Matt Broadstone
            matt.broadstone@mongodb.com Matt Broadstone
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: