[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: |
|
| 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: |
| 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. |