-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
Fully Compatible
-
QE 2024-04-15, QE 2024-04-29, QE 2024-05-13
stdx::unordered_map redirects to absl::node_hash_map which provides pointer stability but involves more heap allocations and indirection than absl::flat_hash_map. We should consider creating a mongo::flat_map defined as absl::flat_hash_map and replace some existing uses of stdx::unordered_map with mongo::flat_map when the context doesn't require pointer stability (most uses satisfy this criteria). Let's only look into this for hot paths, since it's risky and not time efficient to investigate every node hash map that won't get us any measurable performance gains.
We should also look into stdx::unordered_set uses as well, which is defined as absl::node_hash_set.
Note that we don't want to change the definition of stdx::unordered_map to use absl::flat_hash_map because flat_map doesn't provide the same guarantees. This would break code. See https://abseil.io/docs/cpp/guides/container for more details on the absl maps.
- is related to
-
SERVER-90074 Make ValueUnorderedSet an absl::flat_hash_set
- Closed
- related to
-
SERVER-88601 Does using flat_hash_map in BlockHashAgg speed up any TSBS queries?
- Closed