Last active
December 28, 2020 07:28
-
-
Save skanehira/b0fa0b0ab93fc1c75c2cb8c92de81e69 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
package main | |
import "testing" | |
func BenchmarkMapStruct(b *testing.B) { | |
m := map[int]interface{}{ | |
0: 0, | |
} | |
for i := 0; i < b.N; i++ { | |
_ = m[0] | |
} | |
} | |
func BenchmarkMapBool(b *testing.B) { | |
m := map[int]bool{ | |
0: false, | |
} | |
for i := 0; i < b.N; i++ { | |
_ = m[0] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment