Skip to content

Instantly share code, notes, and snippets.

@zhyon404
Created February 12, 2019 10:01
Show Gist options
  • Save zhyon404/4911d07880b68ea8bbc5c374bb51f320 to your computer and use it in GitHub Desktop.
Save zhyon404/4911d07880b68ea8bbc5c374bb51f320 to your computer and use it in GitHub Desktop.
m := make(map[[8]byte][]int64, 1e8)
for i := 0; i < 10; i++ {
start := time.Now()
runtime.GC()
fmt.Printf("GC took %s\n", time.Since(start))
}
runtime.KeepAlive(m)
//x := 10
//var mx [x]int
//fmt.Println(mx)
//m := make(map[int]string)
//m[1] = "xxxxx"
runtime.GC()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment