Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (19 sloc) 339 Bytes
package main
import (
"bytes"
"runtime"
"runtime/pprof"
"testing"
)
func BenchmarkMemstats(b *testing.B) {
for i := 0; i < b.N; i++ {
ms := &runtime.MemStats{}
runtime.ReadMemStats(ms)
}
}
func BenchmarkPProfHeap(b *testing.B) {
for i := 0; i < b.N; i++ {
buf := &bytes.Buffer{}
pprof.Lookup("heap").WriteTo(buf, 1)
}
}
You can’t perform that action at this time.