opentelemetry-cpp
opentelemetry-cpp copied to clipboard
The default size of AttributesHashMap::hash_map_ could be too large
The current AttributesHashMap::hash_map_ has unspecified bucket count which makes it implementation defined. The implementation may starts with some large value like 13 on GCC which wastes memory for scenario where only a few attributes are used. For such scenario, it will be helpful to start with explicit small number of buckets.
std::unordered_map<MetricAttributes, std::unique_ptr<Aggregation>, CustomHash> hash_map_;