cmd/compile: reuseable cache of Prog structs

Reuseable cache of Prog entries.

Improves compiler speed by ~10%.

Update #13646

Change-Id: I01bd8606540d989ea8b8ba5131d1275ba380d976
Reviewed-on: https://go-review.googlesource.com/19868
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Keith Randall 2016-02-24 09:53:27 -08:00
parent 45c2e38b37
commit f388b58540
3 changed files with 19 additions and 1 deletions

View file

@ -618,6 +618,10 @@ type Link struct {
Data *LSym
Etext *LSym
Edata *LSym
// Cache of Progs
allocIdx int
progs [10000]Prog
}
func (ctxt *Link) Diag(format string, args ...interface{}) {