Reduces best of 10 linking of cmd/go by ~5%
Change-Id: If673b877ee12595dae517d7eb48430451e5cadba
Reviewed-on: https://go-review.googlesource.com/20060
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Nhistfile int32
Filesyms *LSym
Moduledata *LSym
+ LSymBatch []LSym
}
// The smallest possible offset from the hardware stack pointer to a local
}
func linknewsym(ctxt *Link, symb string, v int) *LSym {
- s := new(LSym)
- *s = LSym{}
+ batch := ctxt.LSymBatch
+ if len(batch) == 0 {
+ batch = make([]LSym, 1000)
+ }
+ s := &batch[0]
+ ctxt.LSymBatch = batch[1:]
s.Dynid = -1
s.Plt = -1