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.
- is related to
-
SERVER-88564 Eliminate remaining redundant $db parses
- Open
- related to
-
SERVER-85791 Only parse command request once in command processing path
- Closed