[SERVER-65079] Investigate if the MozJS upgrade made creating JS scope more efficient. Created: 30/Mar/22  Updated: 27/Dec/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Ethan Zhang (Inactive) Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: qi-javascript
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-45454 Desugar $where to $expr + $function Closed
Assigned Teams:
Query Integration
Participants:

 Description   

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.


Generated at Thu Feb 08 06:01:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.