Closed miroslavp closed 1 year ago
I have a suggestion for the code bellow in the Resize() method: https://github.com/Wsm2110/Faster.Map/blob/883c9fe55030bb0be7cd90e166ee7d2c6e931924/src/DenseMapSIMD.cs#L758-L762 It can be simplified to
var oldEntries = _entries.Clone(); var oldMetadata = _metadata.Clone();
It looks simpler and is slightly faster. I tried it with array of 1_000_000 ints and it was about 30% faster. Both the Array.Copy and Array.Clone make shallow copy.
Thnx, didn`t know that :)
I have a suggestion for the code bellow in the Resize() method: https://github.com/Wsm2110/Faster.Map/blob/883c9fe55030bb0be7cd90e166ee7d2c6e931924/src/DenseMapSIMD.cs#L758-L762 It can be simplified to
It looks simpler and is slightly faster. I tried it with array of 1_000_000 ints and it was about 30% faster. Both the Array.Copy and Array.Clone make shallow copy.