| In OGM, we usually use CollectionHelper.newHashMap(int initialCapacity) to avoid the resizing of the HashMap after its initialization. The issue is that it's doing more harm than good because the default load factor is of 0.75 so the initial size of the map is always smaller than what we expect and it's always resized. We should rename the parameter to expectedSize instead of initialCapacity and calculate the size taking into account the default load factor. |