]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: performance changes for relocsym
authorThan McIntosh <thanm@google.com>
Thu, 30 Apr 2020 14:19:28 +0000 (10:19 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 30 Apr 2020 21:04:11 +0000 (21:04 +0000)
commitca290169ab219a414dbae8124f442559c907ea4d
tree332a1e8110cb38f1aa328e48d2c45994695a101e
parent1419445926fe9424dad72b82344c6f52b0679cf3
[dev.link] cmd/link: performance changes for relocsym

Revise the signature for "relocsym" to reflect the fact that many of
its arguments are invariant: push the invariant args into a struct and
pass the struct by reference.

Add a facility for doing batch allocation of external relocations in
relocsym, so that we don't wind up with wasted space due to the
default "append" behavior.

This produces a small speedup in linking kubelet:

$ benchstat out.devlink.txt out.dodata.txt
name                        old time/op  new time/op  delta
RelinkKubelet                14.2s ± 2%   13.8s ± 2%  -3.11%  (p=0.000 n=19+19)
RelinkKubelet-WithoutDebug   8.02s ± 3%   7.73s ± 3%  -3.67%  (p=0.000 n=20+20)

Change-Id: I8bc94c366ae792a5b0f23697b8e0108443a7a748
Reviewed-on: https://go-review.googlesource.com/c/go/+/231138
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/data.go