Implement a hybrid sbe::getField() approach to balance both short & long field names

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QE 2026-03-16
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-120255 optimized bson::getField() in SBE to use strlen() + length comparison + memcmp instead of byte-by-byte strcmp. This delivered significant improvements for realistic field name lengths (73-75% faster for 64-char names, 21-45% for 17-char names), but regressed repeated_path_traversal and coll_scan_complex_predicate benchmarks by ~17-19% (BF-41932, accepted by Product Performance).

      The regression occurs because strlen() is called on every BSON field name during iteration — even on misses — to compute the field name length needed by bson::advance(). With short (1-2 char) field names and high miss rates, this is slower than the old byte-by-byte compare that bailed at the first mismatching byte.

            Assignee:
            Catalin Sumanaru
            Reporter:
            Catalin Sumanaru
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: