Last active
August 6, 2021 11:39
-
-
Save percybolmer/8f5c3806c32a615c4ccef18c34181f09 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// insertXPreallocIntMap is used to add X amount of items into a Map[int]int | |
func insertXPreallocIntMap(x int, b *testing.B) { | |
// Initialize Map and Insert X amount of items and Prealloc the size to X | |
testmap := make(map[int]int, x) | |
// Reset timer after Initalizing map, that's not what we want to test | |
b.ResetTimer() | |
for i := 0; i < x; i++ { | |
// Insert value of I into I key. | |
testmap[i] = i | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment