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

BSONIteratorSorted should reuse calculated fieldName size

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 5.0.0-rc0
    • None
    • None
    • None
    • Fully Compatible
    • Execution Team 2021-04-19

    Description

      BSONIteratorSorted traverses the provided BSONObj to collect all field names. But when storing it just uses char*.

      This leads to the comparator having to re-calculate the field name size over and over again during the sorting stage.

      Later when a user is extracting BSONElements in sorted order the field name sizes are calculated yet again.

      We should be able to just calculate it once and then reuse.

      Attachments

        Activity

          People

            henrik.edin@mongodb.com Henrik Edin
            henrik.edin@mongodb.com Henrik Edin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: