]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link/internal/loader: do more bulk allocation
authorThan McIntosh <thanm@google.com>
Thu, 24 Oct 2019 15:27:47 +0000 (11:27 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 1 Nov 2019 18:49:50 +0000 (18:49 +0000)
commit5aea597905f914bb0c8d0d986e17c5022cf9aed1
treec2ff35b37d1ac2e531a6ccd85d91de3e49f88b37
parente961b26c274498f9e9bf17a6609dbc0f542f2d40
[dev.link] cmd/link/internal/loader: do more bulk allocation

Change the loader to do more bulk allocation when making slices of
small objects (sym.Reloc, etc) as part of creating and populating
sym.Symbols in loader.LoadFull(). This replaces a large number of
small allocations with a smaller number of large allocations,
improving performace. Compilebench numbers (linker portion) for this
change:

name                      old time/op       new time/op       delta
LinkCompiler                    1.71s ±11%        1.57s ± 9%   -8.35%  (p=0.000 n=19+20)
LinkWithoutDebugCompiler        1.19s ±14%        1.10s ±13%   -7.93%  (p=0.000 n=20+19)

name                      old user-time/op  new user-time/op  delta
LinkCompiler                    1.86s ±15%        1.34s ±10%  -28.02%  (p=0.000 n=20+20)
LinkWithoutDebugCompiler        1.05s ±14%        0.95s ± 9%   -9.17%  (p=0.000 n=19+20)

Hyperkube from kubernetes doesn't show any significant benefit (which
seems a little surprising).

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