[SERVER-64036] Avoid making a copy of JsFunction when generating an SBE plan Created: 28/Feb/22 Updated: 17/Jan/24 Resolved: 07/Mar/22 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | Backlog |
| Fix Version/s: | 5.3.0-rc3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Anton Korshunov | Assignee: | Anton Korshunov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Sprint: | QO 2022-03-07, QO 2022-03-21 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 15 | ||||||||||||
| Description |
|
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. |
| Comments |
| Comment by Githook User [ 07/Mar/22 ] |
|
Author: {'name': 'Anton Korshunov', 'email': 'anton.korshunov@mongodb.com', 'username': 'antkorsh'}Message: |