mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00: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
2 changed files with 8 additions and 3 deletions
|
|
@ -57,15 +57,16 @@ func Compile(f *Func) {
|
||||||
if logMemStats {
|
if logMemStats {
|
||||||
var mEnd runtime.MemStats
|
var mEnd runtime.MemStats
|
||||||
runtime.ReadMemStats(&mEnd)
|
runtime.ReadMemStats(&mEnd)
|
||||||
nAllocs := mEnd.TotalAlloc - mStart.TotalAlloc
|
nBytes := mEnd.TotalAlloc - mStart.TotalAlloc
|
||||||
stats = fmt.Sprintf("[%d ns %d bytes]", time, nAllocs)
|
nAllocs := mEnd.Mallocs - mStart.Mallocs
|
||||||
|
stats = fmt.Sprintf("[%d ns %d allocs %d bytes]", time, nAllocs, nBytes)
|
||||||
} else {
|
} else {
|
||||||
stats = fmt.Sprintf("[%d ns]", time)
|
stats = fmt.Sprintf("[%d ns]", time)
|
||||||
}
|
}
|
||||||
|
|
||||||
f.Logf(" pass %s end %s\n", p.name, stats)
|
f.Logf(" pass %s end %s\n", p.name, stats)
|
||||||
printFunc(f)
|
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)
|
checkFunc(f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,10 @@ func (w *HTMLWriter) start(name string) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.stats {
|
||||||
|
font-size: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
border: 1px solid black;
|
border: 1px solid black;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue