Created
June 23, 2015 10:17
-
-
Save hackintoshrao/459b61ea2f6ef0dd6292 to your computer and use it in GitHub Desktop.
Functions in which elements from maps and structs are accessed and added and later tested for their benchmark in a test file ,here is the link of the code form the repo https://github.com/Karthic-Hackintosh/Codes-From-My-Blog-posts/blob/master/121/bench1/mapAndStructAdd.go
This file contains 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 gobench | |
func GoMapAdd() { | |
m := map[int]int{0: 0, 1: 1} | |
_ = m[0] + m[1] | |
} | |
func GoStructAdd() { | |
m := struct{ a, b int }{0, 1} | |
_ = m.a + m.b | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment