[SERVER-27263] bsonExtract*WithDefault inefficient in default case Created: 02/Dec/16 Updated: 06/Dec/17 Resolved: 22/Jun/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.10 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | Tyler Kaye |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng, platforms-interns-2017 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Sprint: | Platforms 2017-06-19, Platforms 2017-07-10 | ||||||||
| Participants: | |||||||||
| Description |
|
The bsonExtract methods in bson_extract.cpp all rely on bsonExtractField() to parse the provided BSONObj. In the case where the requested field is missing, bsonExtractField() will generate an error Status object and build an error message using str::stream() both of which are expensive operations for a non-error path. We should optimize the "WithDefault" methods to avoid generating an error Status object in the case where the requested field does not exist. |
| Comments |
| Comment by Githook User [ 22/Jun/17 ] |
|
Author: {u'username': u'tkaye407', u'name': u'Tyler Kaye', u'email': u'tyler.kaye@mongodb.com'}Message: |