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

Investigate if the MozJS upgrade made creating JS scope more efficient.

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Query Integration

      Today, $where and $function have different ways of obtaining JS scope.
      $where chose to use a scope object from a shared pool, whereas $function chose to create one from scratch for each user operation. The pooled scope saves creation costs but is more expensive to access. This is great for short-lived operations. The other option reverses the costs.

      In SERVER-45454, we did the change to translate $where to $function. Then we can remove the existing implementation of $where to simplify our codebase.

      However, we put this change behind the internalQueryDesugarWhereToFunction knob due to benchmark slowdown. The recent upgrade of MozJS showed some performance improvements across the board (See BF-24588). So we start to wonder if now is a better time to revisit SERVER-45454's change, releasing it from the knob.

      A good first step here is to run some performance tests to understand if the MozJS upgrade can bring some performance improvements to creating JS scopes, which is what we want to achieve here in this ticket.

            Assignee:
            backlog-query-integration [DO NOT USE] Backlog - Query Integration
            Reporter:
            ethan.zhang@mongodb.com Ethan Zhang (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: