Optimize NamespaceString construction in authorization path

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.1.0-rc0, 7.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • v7.0
    • Server Serverless 2023-05-15, Server Serverless 2023-05-29
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

              Assignee:
              Matt Broadstone
              Reporter:
              Matt Broadstone
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: