The memory usage increases sharply
In versions v1.4.0 and v1.2.0 compared to v1.0.1, when I use robin_map and insert a very large value as a key, the memory consumption increases sharply.
You can generate large keys using the following code:
std::vector<int64_t> ids(count);
for (int64_t i = 0; i < count; ++i) {
ids[i] = (i << 48);
}
Do you use the identity hash function? That would create a lot of collisions with the default map, which uses a power of two for the size of the table, using the keys you insert. Can you try tsl::robin_pg_map or with another hash function?
See the second paragraph of the README:
Four classes are provided: tsl::robin_map, tsl::robin_set, tsl::robin_pg_map and tsl::robin_pg_set. The first two are faster and use a power of two growth policy, the last two use a prime growth policy instead and are able to cope better with a poor hash function. Use the prime version if there is a chance of repeating patterns in the lower bits of your hash (e.g. you are storing pointers with an identity hash function). See GrowthPolicy for details.