]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.ssa] cmd/compile: add allocs to pass stats
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 5 Sep 2015 00:33:56 +0000 (17:33 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Sat, 5 Sep 2015 02:25:42 +0000 (02:25 +0000)
Also, improve HTML formatting.

Change-Id: I07e2482a30862e2091707f260a2c43d6e9a85d97
Reviewed-on: https://go-review.googlesource.com/14333
Reviewed-by: Todd Neal <todd@tneal.org>
src/cmd/compile/internal/ssa/compile.go
src/cmd/compile/internal/ssa/html.go

index a9365e91e191c4d816a802e17411100bb76d1ca3..1c2b7ac2a8a9b2be7ad1f40e5d95548c2cd60eba 100644 (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)
        }
 
index 44e4e19b777f02bf66768796c7bdee4a52ebfe14..c84dccf793cf5e9ab589d047179da067143c9eb8 100644 (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;