-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query
-
Platforms 2017-06-19
The bsonExtract* methods in bsonExtract.cpp are often used to both determine whether a field exists and in the case it does parse out of a BSONObj, with both results being considered valid. In the case where a field does not exist we 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 consider adding methods (or modifying current ones) to support extraction or fast NoSuchKey return in the case the field doesn't exist (without return of an error Status object). This ticket should focus on the methods outside of the "WithDefault" ones, which will be handled under SERVER-27263.
After completing this ticket we should perform an audit of the code base and enter follow-on tickets to address cases where NoSuchKey is being handled after bsonin a non-error situation. A few (out of many) examples of this:
- is related to
-
SERVER-27263 bsonExtract*WithDefault inefficient in default case
- Closed
- related to
-
SERVER-27176 Improve performance of command writeConcern parsing
- Closed