1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:04:46 -07:00

go.tools/ssa: include line count in stdlib_test.

R=gri
CC=golang-dev
https://golang.org/cl/20860043
This commit is contained in:
Alan Donovan 2013-11-01 14:32:44 -04:00
parent d9d5e51406
commit 0faac9ebe6

View File

@ -11,6 +11,7 @@ package ssa_test
import (
"go/build"
"go/token"
"os"
"path/filepath"
"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("#Source lines: ", lineCount)
t.Log("Load/parse/typecheck: ", t1.Sub(t0))
t.Log("SSA create: ", t2.Sub(t1))
t.Log("SSA build: ", t3.Sub(t2))