mirror of
https://github.com/golang/go
synced 2024-11-18 04:14:49 -07:00
cmd/compilebench: report rss measurement
Change-Id: I4a0f6e75dea97413ab22f589ae2b4f36bec4b081 Reviewed-on: https://go-review.googlesource.com/c/tools/+/223750 Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
2944c61d58
commit
dba9bee06b
@ -440,8 +440,8 @@ func runBuildCmd(name string, count int, dir, tool string, args []string) error
|
||||
}
|
||||
end := time.Now()
|
||||
|
||||
haveAllocs := false
|
||||
var allocs, allocbytes int64
|
||||
haveAllocs, haveRSS := false, false
|
||||
var allocs, allocbytes, rssbytes int64
|
||||
if *flagAlloc || *flagMemprofile != "" {
|
||||
out, err := ioutil.ReadFile(dir + "/_compilebench_.memprof")
|
||||
if err != nil {
|
||||
@ -462,6 +462,9 @@ func runBuildCmd(name string, count int, dir, tool string, args []string) error
|
||||
allocbytes = val
|
||||
case "Mallocs":
|
||||
allocs = val
|
||||
case "MaxRSS":
|
||||
haveRSS = true
|
||||
rssbytes = val
|
||||
}
|
||||
}
|
||||
if !haveAllocs {
|
||||
@ -502,6 +505,9 @@ func runBuildCmd(name string, count int, dir, tool string, args []string) error
|
||||
if haveAllocs {
|
||||
fmt.Printf(" %d B/op %d allocs/op", allocbytes, allocs)
|
||||
}
|
||||
if haveRSS {
|
||||
fmt.Printf(" %d maxRSS/op", rssbytes)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user