Commit a3f72956 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

[dev.ssa] cmd/compile: add allocs to pass stats

Also, improve HTML formatting.

Change-Id: I07e2482a30862e2091707f260a2c43d6e9a85d97
Reviewed-on: https://go-review.googlesource.com/14333Reviewed-by: default avatarTodd Neal <todd@tneal.org>
parent 1b5ffda0
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment