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

bsonExtract*WithDefault inefficient in default case

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 3.5.10
    • None
    • Fully Compatible
    • 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

              tyler.kaye@mongodb.com Tyler Kaye
              james.wahlin@mongodb.com James Wahlin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: