You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the weblist command in pprof now generates an unreasonably large html file. In Go1.6 this generates a 209KB html file, while HEAD generates a 450MB html file for even a simple benchmark. On larger benchmarks (which are far more common), this crashes the system by using up all system memory.
Current behavior:
$ go.dev test -c foo_test.go
$ ./foo.test -test.bench . -test.cpuprofile /tmp/cpu.out
$ go.dev tool pprof ./foo.test /tmp/cpu.out
(pprof) weblist # Stalls for several seconds... the output html file is 450MB
Wanted behavior:
$ go1.6 test -c foo_test.go
$ ./foo.test -test.bench . -test.cpuprofile /tmp/cpu.out
$ go1.6 tool pprof ./foo.test /tmp/cpu.out
(pprof) weblist # Immediately launches browser with html file that is 209KB
Contents of foo_test.go (could be anything):
package foo
import (
"bufio"
"io"
"strings"
"testing"
)
func BenchmarkFoo(b *testing.B) {
s := strings.Repeat("Hello, world!", 100000)
b.SetBytes(int64(len(s)))
for i := 0; i < b.N; i++ {
var r io.ByteReader
r = bufio.NewReader(strings.NewReader(s))
for {
_, err := r.ReadByte()
if err != nil {
if err == io.EOF {
break
}
b.Fatal(err)
}
}
}
}
The text was updated successfully, but these errors were encountered:
Using 4764d6f
Using the
weblist
command in pprof now generates an unreasonably large html file. InGo1.6
this generates a 209KB html file, whileHEAD
generates a 450MB html file for even a simple benchmark. On larger benchmarks (which are far more common), this crashes the system by using up all system memory.Current behavior:
Wanted behavior:
Contents of foo_test.go (could be anything):
The text was updated successfully, but these errors were encountered: