]> Cypherpunks repositories - gostls13.git/commit
cmd/compile, cmd/link: eliminate string merging pass
authorRuss Cox <rsc@golang.org>
Tue, 8 Mar 2016 03:48:07 +0000 (22:48 -0500)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 8 Mar 2016 19:14:08 +0000 (19:14 +0000)
commit21af2d39c25f71a3044c40e7b106b8c47d06a6a0
tree74e95259576093e2dbdd1e6a0e0a4852ab3c0c33
parentfb880b8a03f33b6a1809d76e7673717875c74606
cmd/compile, cmd/link: eliminate string merging pass

Deleting the string merging pass makes the linker 30-35% faster
but makes jujud (using the github.com/davecheney/benchjuju snapshot) 2.5% larger.
Two optimizations bring the space overhead down to 0.6%.

First, change the default alignment for string data to 1 byte.
(It was previously defaulting to larger amounts, usually pointer width.)

Second, write out the type string for T (usually a bigger expression) as "*T"[1:],
so that the type strings for T and *T share storage.

Combined, these obtain the bulk of the benefit of string merging
at essentially no cost. The remaining benefit from string merging
is not worth the excessive cost, so delete it.

As penance for making the jujud binary 0.6% larger,
the next CL in this sequence trims the reflect functype
information enough to make the jujud binary overall 0.75% smaller
(that is, that CL has a net -1.35% effect).

For #6853.
Fixes #14648.

Change-Id: I3fdd74c85410930c36bb66160ca4174ed540fc6e
Reviewed-on: https://go-review.googlesource.com/20334
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
src/cmd/compile/internal/gc/reflect.go
src/cmd/internal/obj/link.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/mergestrings.go [deleted file]
src/cmd/link/internal/ld/pobj.go
src/cmd/link/internal/ld/symtab.go