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

Avoid making a copy of JsFunction when generating an SBE plan

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0-rc3
    • Affects Version/s: Backlog
    • Component/s: None
    • None
    • Fully Compatible
    • QO 2022-03-07, QO 2022-03-21
    • 15

      Currently when we construct an WhereMatchExpression we instantiate a JsFunction object, which is a wrapper encapsulating common logic for running JS code in $where expression.

      When we translate this expression into an SBE plan, we make a copy of this JsFunction object, which is an expensive operation, since we re-parse and re-compile the JS function from scratch. Instead, we should reuse the original object stored in WhereMatchExpression since this expression will never need it again once translated into SBE.

            Assignee:
            anton.korshunov@mongodb.com Anton Korshunov
            Reporter:
            anton.korshunov@mongodb.com Anton Korshunov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: