Improve performance of ByteCode::getField()

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • QE 2025-07-21
    • 200
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      After switching to the toolchain v5 as default in 341832a we've observed few performance regressions including a 10% regression in ElemMatchLargeMixedInAndOrWithDuplicates causing BF-37502.

      It was determined that on AWS Graviton2 under the mentioned workload the branch misprediction rate increased ~2.5 times while the number of branches executed increased ~5%.

      The improvement to ByteCode::getField() aims to reduce the number of branches executed and switch to static branch prediction by avoiding taking branches for presumably the most common execution scenario - when the input is a BSON object.

      This change seems to reduce the run-time of the workload by ~2%.

              Assignee:
              Mindaugas Malinauskas
              Reporter:
              Mindaugas Malinauskas
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: