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

Speed up BSONObj::getField

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • None
    • None
    • None
    • Storage Execution
    • Fully Compatible
    • Execution Team 2024-02-19

    Description

      We leave some perf on the table for this basic field lookup in a BSONObj. As this is fundamentally a parsing problem, we should only look at every byte once. However, we first scan the field name to determine its length (as part of constructing the BSONElement), and then we go back to compare the field name with the one we're looking for. If we start with comparing the field name, we avoid extra checks. 

      This results in a speedup of up to 70% on the bson_bm array lookup test case.

      Attachments

        Activity

          People

            geert.bosch@mongodb.com Geert Bosch
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: