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

Speed up BSONObj::getField

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • Fully Compatible
    • Execution Team 2024-02-19
    • 35

      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.

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

              Created:
              Updated:
              Resolved: