Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-27263

bsonExtract*WithDefault inefficient in default case

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.10
    • Component/s: None
    • Backwards Compatibility:
      Fully Compatible
    • Sprint:
      Platforms 2017-06-19, Platforms 2017-07-10

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: