[SERVER-47945] Reduce the cost of extractOrAppendOk Created: 04/May/20  Updated: 29/Oct/23  Resolved: 05/May/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.4.0-rc6, 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Amirsaman Memaripour
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4
Sprint: Service arch 2020-05-18
Participants:

 Description   

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).


 Comments   
Comment by Githook User [ 05/May/20 ]

Author:

{'name': 'Amirsaman Memaripour', 'email': 'amirsaman.memaripour@mongodb.com', 'username': 'samanca'}

Message: SERVER-47945 Reduce the cost of extractOrAppendOk
Branch: master
https://github.com/mongodb/mongo/commit/e259a8a4194a43c1c08beb0db091b40c073b3e1a

Generated at Thu Feb 08 05:15:41 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.