Found when analyzing the flamegraphs for the benchmarks introduced in SERVER-85814.
As part of QueryPlannerAnalysis::analyzeDataAccess(), we perform sort and covering analysis to optimize plans. This is invoked during regular query planning as well when recovering plans from the classic plan cache.
Here, when we remove equality from sort objects, it appears that we invoke removeFields on a BSONObj, which performs an allocation to copy non-removed fields over. Then we immediately pass that object to QueryPlannerAnalysis::getSortPattern which performs another BSONObj allocation to construct the sort pattern.
We should be able to avoid the intermediate allocation and do this in a single pass.
- is related to
-
SERVER-85814 Introduce Google benchmark for plan cache retrieval and parameter binding [classic]
-
- Closed
-