Closed linjiahao962889027 closed 1 year ago
Thanks @linjiahao962889027, this is a good suggestion, I'll look into it.
Hey @linjiahao962889027 , this should fix your issue, please let me know if you see any problem.
Hey @linjiahao962889027 , this should fix your issue, please let me know if you see any problem. Awesome!!! It seems very great!!!
Description: When both the Key and Value types are trivial classes, I suggest modifying the behavior of clear in flat_hash_map to avoid releasing memory, similar to the behavior of std::vector. The current reallocation during clear impacts performance due to the second allocation, especially for trivial types where memory deallocation isn't necessary. This change would align the behavior with other standard containers, providing better performance for scenarios where frequent clearing is required.