After LoadFull, we'll be using sym.Symbols mostly. We still need
the loader information for symbol index mappings and name
lookups, but not much else. Free some memory.
Linking cmd/compile,
name old time/op new time/op delta
Loadlibfull_GC 44.5M ± 0% 35.8M ± 0% -19.66% (p=0.008 n=5+5)
Archive_GC 46.4M ± 0% 37.6M ± 0% -18.89% (p=0.008 n=5+5)
Linking cmd/compile with external linking,
name old time/op new time/op delta
Loadlibfull_GC 82.5M ± 0% 57.4M ± 0% -30.41% (p=0.008 n=5+5)
Archive_GC 86.8M ± 0% 61.7M ± 0% -28.90% (p=0.008 n=5+5)
Change-Id: I6859d488172ef8968918b86de527fbfed6832ebf
Reviewed-on: https://go-review.googlesource.com/c/go/+/230300
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
for m := d.ms; m != nil; m = m.next {
m.off = uint64(pefile.nextSectOffset) + uint64(ctxt.Out.Offset()) - uint64(startoff)
ctxt.Out.Write16(0) // hint
- strput(ctxt.Out, ldr.SymExtname(m.s))
+ strput(ctxt.Out, ldr.Syms[m.s].Extname())
}
}
}
}
}
+
+ // Free some memory.
+ // At this point we still need basic index mapping, and some fields of
+ // external symbol payloads, but not much else.
+ l.values = nil
+ l.symSects = nil
+ l.outdata = nil
+ l.itablink = nil
+ l.attrOnList = nil
+ l.attrLocal = nil
+ l.attrNotInSymbolTable = nil
+ l.attrVisibilityHidden = nil
+ l.attrDuplicateOK = nil
+ l.attrShared = nil
+ l.attrExternal = nil
+ l.attrReadOnly = nil
+ l.attrTopFrame = nil
+ l.attrSpecial = nil
+ l.attrCgoExportDynamic = nil
+ l.attrCgoExportStatic = nil
+ l.outer = nil
+ l.align = nil
+ l.dynimplib = nil
+ l.dynimpvers = nil
+ l.localentry = nil
+ l.extname = nil
+ l.elfType = nil
+ l.plt = nil
+ l.got = nil
+ l.dynid = nil
+ l.relocVariant = nil
+ l.extRelocs = nil
}
// ResolveABIAlias given a symbol returns the ABI alias target of that