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

bsonExtract*WithDefault inefficient in default case

    • Fully Compatible
    • Platforms 2017-06-19, Platforms 2017-07-10

      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.

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

              Created:
              Updated:
              Resolved: