1
0
mirror of https://github.com/golang/go synced 2024-10-05 16:31:21 -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:
Josh Bleecher Snyder 2015-09-04 17:33:56 -07:00
parent 1b5ffda01e
commit a3f72956f1
2 changed files with 8 additions and 3 deletions

View File

@ -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)
}

View File

@ -45,6 +45,10 @@ func (w *HTMLWriter) start(name string) {
display: none;
}
.stats {
font-size: 60%;
}
table {
border: 1px solid black;
table-layout: fixed;