-
Type: Task
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
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.
- is related to
-
SERVER-45454 Desugar $where to $expr + $function
- Closed