-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
Refactor IndexScan stage to improve performance.
Suggested changes:
- Remove unnecessary virtual calls from IndexScan stage. If code sahring between Simple and Generic index scan is desired a templates can be used for methods that would need to otherwise call virtual methods.
- Refactor code and branching so that open and getNext have minimal size. All expensive/optional operatations can be extracted to separate methods to discourage inlining of code that is often skipped.
- Encourage inlining of small methods on the hot path.
- Move loop invariants out of the loop. e.g. Some slot assignment is invariant and can be done in open/prepare phase, and no longer needs assignment in getNext.
- Reduce frequency of calling into YieldPolicy, at minimum we should be able to gate the yield checks behind the counter even if yield policy is present.
A POC here https://github.com/10gen/mongo/compare/anna.wawrzyniak/SERVER-85623?expand=1 demonstrates the above changes and possible performance improvement (see SERVER-85623)
- is related to
-
SERVER-85623 Investigate why SBE ixscan+fetch is ~15% slower equivalent handcrafted index scan
- Closed