From 0faac9ebe650ced04722ed72214b45976211471b Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Fri, 1 Nov 2013 14:32:44 -0400 Subject: [PATCH] go.tools/ssa: include line count in stdlib_test. R=gri CC=golang-dev https://golang.org/cl/20860043 --- ssa/stdlib_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ssa/stdlib_test.go b/ssa/stdlib_test.go index bf36db86..51d0280b 100644 --- a/ssa/stdlib_test.go +++ b/ssa/stdlib_test.go @@ -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))