]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: apply relocations while writing symbols
authorCherry Zhang <cherryyz@google.com>
Sat, 20 Jun 2020 18:38:38 +0000 (14:38 -0400)
committerCherry Zhang <cherryyz@google.com>
Tue, 23 Jun 2020 00:57:30 +0000 (00:57 +0000)
commit37682f7a797a2f13dcc5496e506bfd662f6e51fd
tree32c1252b28ab65873fcb8116f9e0d1e6dbbd6110
parent5e526e67e7fcb577c446b74b59fb7a53343288f1
[dev.link] cmd/link: apply relocations while writing symbols

We can apply relocations of a symbol right after the symbol data
is copied to output buffer. This should help locality and
parallelism (parallelizing over blocks, instead of over segments).

Linking cmd/compile,
Asmb+Reloc     23.9ms ±18%    16.5ms ±11%   -30.73%  (p=0.008 n=5+5)

Linking cmd/compile with external linking,
Asmb+Reloc     74.0ms ± 3%    33.8ms ± 8%   -54.32%  (p=0.008 n=5+5)

In external linking mode, allocation goes up slightly, as we do
smaller batching now. It doesn't seem too bad.
Asmb+Reloc     15.0MB ± 0%    16.7MB ± 0%   +11.22%  (p=0.008 n=5+5)

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