[SERVER-21481] Optimize BSONObjBuilder::numStr Created: 16/Nov/15  Updated: 25/Nov/15  Resolved: 18/Nov/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.2.0-rc4

Type: Improvement Priority: Major - P3
Reporter: Adam Midvidy Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File find.js     File insert.js     PNG File numstre.png    
Backwards Compatibility: Fully Compatible
Sprint: Platform C (11/20/15), Platform D (12/11/15)
Participants:

 Description   

In the getMore command we need to construct a large BSON array of cursor response documents. If the documents are small, the indices of the elements can hit well over 100, which is the limit of the fast path for BSONObjBuilder::numStr. Under vTune we can see that we are spending almost 25% of our cycles in numStr for an in-memory collection scan workload.



 Comments   
Comment by Githook User [ 18/Nov/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-21481 optimize generating indices in BSONArrayBuilder
Branch: master
https://github.com/mongodb/mongo/commit/f59b2b7634b1c4c84e3f8f096a4e895986bf4d30

Comment by Adam Midvidy [ 16/Nov/15 ]

I've attached the script I used to generate the load. Run insert.js once, then run find.js repeatedly as needed.

Generated at Thu Feb 08 03:57:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.