Approximately 1.2% of samples collected as part of profiling mongos correspond to extractOrAppendOk(). The computation complexity of this method (see here) could be reduced through the following:
- Replace the call to appendSimpleCommandStatus() with this line.
- Potentially caching some of the most frequently used fields in BSONObjBuilder to obviate the call to asTempObj() (and potentially scanning the entire BSON object).