Closed
Description
Go version is 1.4.2 and Go devel +80864cf Fri May 29 04:33:15 2015 +0000
.
OS is linux/amd64.
GC pause time is about 600ms on Go 1.5 and 300ms on Go 1.4.
Sample code to test GC pause time.
package main
import (
"fmt"
"runtime"
"runtime/debug"
"time"
)
func GCPause() time.Duration {
runtime.GC()
var stats debug.GCStats
debug.ReadGCStats(&stats)
return stats.Pause[0]
}
func main() {
n := 3000 * 1000
m := make(map[string][]byte)
for i := 0; i < n; i++ {
key := fmt.Sprintf("key%v", i)
val := make([]byte, 10)
m[key] = val
}
fmt.Println("GC pause with 3 million map entries:", GCPause())
}