]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: reduce allocations in Preload
authorCherry Zhang <cherryyz@google.com>
Mon, 11 May 2020 19:11:36 +0000 (15:11 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 12 May 2020 14:46:37 +0000 (14:46 +0000)
commit4098ab3ff4de53df4bf2e9b2db0f49e4d12b3d9c
tree87d15c3bb4a4b0b85ab71052c5c584c47c730388
parent25e9417b9807bc6166b127f698d145ce060cd23f
[dev.link] cmd/link: reduce allocations in Preload

Don't create loader.Syms until LoadFull (it will be gone soon
anyway.)

Preallocate loader.objSym array.

Don't create loader.values until preloading is done.

Linking cmd/compile:

name           old alloc/op   new alloc/op   delta
Loadlib_GC       36.2MB ± 0%    20.0MB ± 0%  -44.91%  (p=0.016 n=5+4)

Change-Id: I82eddcfa7fb8fc4e84e8174a47e59cf1183dd83b
Reviewed-on: https://go-review.googlesource.com/c/go/+/233341
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/loader/loader.go