]> Cypherpunks repositories - gostls13.git/commit
cmd/link, cmd/compile: Add symbol references to object file.
authorShahar Kohanim <skohanim@gmail.com>
Mon, 14 Mar 2016 20:57:58 +0000 (22:57 +0200)
committerDavid Crawshaw <crawshaw@golang.org>
Tue, 15 Mar 2016 13:00:07 +0000 (13:00 +0000)
commit3648d2d4cd5dfe20fc25ebcf391176e65c056110
tree5a17b24113d5bdb4c3892868611809fed4c163d1
parentea4b785ae03a067f4a26adac78213ff6caac5128
cmd/link, cmd/compile: Add symbol references to object file.

Symbols in the object file currently refer to each other using symbol name
and version. Referring to the same symbol many times in an object file takes
up space and causes redundant map lookups. Instead write out a list of unique
symbol references and have symbols refer to each other using indexes into this
list.

Credit to Michael Hudson-Doyle for kicking this off.

Reduces pkg/linux_amd64 size by 30% from 61MB to 43MB

name       old s/op   new s/op   delta
LinkCmdGo  0.74 ± 3%  0.63 ± 4%  -15.22%  (p=0.000 n=20+20)
LinkJuju   6.38 ± 6%  5.73 ± 6%  -10.16%  (p=0.000 n=20+19)

Change-Id: I7e101a0c80b8e673a3ba688295e6f80ea04e1cfb
Reviewed-on: https://go-review.googlesource.com/20099
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/internal/goobj/read.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/sizeof_test.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/objfile.go