Open sjakobi opened 2 years ago
https://github.com/haskell-unordered-containers/unordered-containers/blob/b6bde46eae679111c3f088964f192290cc08b6c8/Data/HashMap/Internal.hs#L2181-L2210
I think that we could avoid allocating the intermediary indices array. Instead over-allocate the output array and shrink (#362) it once we've determined the final size.
indices
When matching the keys we could also use a similar optimization as suggested in https://github.com/haskell-unordered-containers/unordered-containers/issues/291.
https://github.com/haskell-unordered-containers/unordered-containers/blob/b6bde46eae679111c3f088964f192290cc08b6c8/Data/HashMap/Internal.hs#L2181-L2210
I think that we could avoid allocating the intermediary
indices
array. Instead over-allocate the output array and shrink (#362) it once we've determined the final size.When matching the keys we could also use a similar optimization as suggested in https://github.com/haskell-unordered-containers/unordered-containers/issues/291.