Details
-
Improvement
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
3.6.0
-
None
-
Fully Compatible
-
v3.6
-
Platforms 2018-01-01, Platforms 2018-01-15
-
0
Description
As a part of SERVER-30761, we refactored parseInExpression() and changed a loop that looked like
BSONObjIterator iter(theArray);
|
while (iter.more()) { |
auto e = iter.next();
|
// ... |
}
|
into
for (auto e : theArray) { |
// ... |
}
|
This has caused a performance regression of roughly 5% when parsing a $in, and is apparent with very large in expressions. The real fix seems like achieving performance parity between the two ways to iterate through a BSONObj, but I'm not sure how much we want to dive down the rabbit hole in terms of seeing the machine code that's generated by the two constructs.
Attachments
Issue Links
- is caused by
-
SERVER-30761 Optimize parsing code for top-level MatchExpressions
-
- Closed
-
- is duplicated by
-
SERVER-17974 speed up BSONObjIterator and BSONObj::getField
-
- Closed
-