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

Eliminate redundant $db parses on common command paths

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Minor Change
    • v8.0
    • Service Arch 2024-04-01, Service Arch 2024-04-15

      On the command path, we currently make a number of calls to OpMsgRequest::getDatabase and OpMsgRequest::getDbName, both of which will walk the entire request document in search of the "$db" field. The latter is particularly expensive, as it also validates the string and makes a copy of it. We only need to retrieve the "$db" field once though and can reuse it as necessary throughout the rest of the command execution. We also don't need to perform a separate scan of the request in order to retrieve this value and can instead just include it with the rest of the parse.

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: