Micro-optimize field lookups in ChangeStreamUnwindTransactionStage

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Trivial - P5
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: Change streams
    • None
    • Query Execution
    • Fully Compatible
    • QE 2025-10-27
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      We can slightly optimize field lookups for change streams in the ChangeStreamUnwindTransactionStage.

      In TransactionOpIterator::_assertExpectedTransactionEventFormat(), we should not use ValueComparator::kInstance.evaluate(), but compare the string value returned by getStringData() against a StringData constant.

      Additionally, we can optimize away the lookup of the o field here in case the operation is not a command. We can instead add an early exit for this case, without looking up the o field at all.

            Assignee:
            Jan Steemann
            Reporter:
            Jan Steemann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: