mirror of
https://github.com/golang/go
synced 2024-10-05 18:31:28 -06:00
[dev.ssa] cmd/compile: add allocs to pass stats
Also, improve HTML formatting. Change-Id: I07e2482a30862e2091707f260a2c43d6e9a85d97 Reviewed-on: https://go-review.googlesource.com/14333 Reviewed-by: Todd Neal <todd@tneal.org>
This commit is contained in:
parent
1b5ffda01e
commit
a3f72956f1
@ -57,15 +57,16 @@ func Compile(f *Func) {
|
||||
if logMemStats {
|
||||
var mEnd runtime.MemStats
|
||||
runtime.ReadMemStats(&mEnd)
|
||||
nAllocs := mEnd.TotalAlloc - mStart.TotalAlloc
|
||||
stats = fmt.Sprintf("[%d ns %d bytes]", time, nAllocs)
|
||||
nBytes := mEnd.TotalAlloc - mStart.TotalAlloc
|
||||
nAllocs := mEnd.Mallocs - mStart.Mallocs
|
||||
stats = fmt.Sprintf("[%d ns %d allocs %d bytes]", time, nAllocs, nBytes)
|
||||
} else {
|
||||
stats = fmt.Sprintf("[%d ns]", time)
|
||||
}
|
||||
|
||||
f.Logf(" pass %s end %s\n", p.name, stats)
|
||||
printFunc(f)
|
||||
f.Config.HTML.WriteFunc(fmt.Sprintf("after %s %s", phaseName, stats), f)
|
||||
f.Config.HTML.WriteFunc(fmt.Sprintf("after %s <span class=\"stats\">%s</span>", phaseName, stats), f)
|
||||
checkFunc(f)
|
||||
}
|
||||
|
||||
|
@ -45,6 +45,10 @@ func (w *HTMLWriter) start(name string) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.stats {
|
||||
font-size: 60%;
|
||||
}
|
||||
|
||||
table {
|
||||
border: 1px solid black;
|
||||
table-layout: fixed;
|
||||
|
Loading…
Reference in New Issue
Block a user