go.tools/ssa: include line count in stdlib_test.
R=gri CC=golang-dev https://golang.org/cl/20860043
This commit is contained in:
parent
d9d5e51406
commit
0faac9ebe6
|
|
@ -11,6 +11,7 @@ package ssa_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"go/build"
|
"go/build"
|
||||||
|
"go/token"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
@ -104,7 +105,18 @@ func TestStdlib(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// determine line count
|
||||||
|
var lineCount int
|
||||||
|
imp.Fset.Iterate(func(f *token.File) bool {
|
||||||
|
lineCount += f.LineCount()
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
// NB: when benchmarking, don't forget to clear the debug +
|
||||||
|
// sanity builder flags for better performance.
|
||||||
|
|
||||||
t.Log("GOMAXPROCS: ", runtime.GOMAXPROCS(0))
|
t.Log("GOMAXPROCS: ", runtime.GOMAXPROCS(0))
|
||||||
|
t.Log("#Source lines: ", lineCount)
|
||||||
t.Log("Load/parse/typecheck: ", t1.Sub(t0))
|
t.Log("Load/parse/typecheck: ", t1.Sub(t0))
|
||||||
t.Log("SSA create: ", t2.Sub(t1))
|
t.Log("SSA create: ", t2.Sub(t1))
|
||||||
t.Log("SSA build: ", t3.Sub(t2))
|
t.Log("SSA build: ", t3.Sub(t2))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue