mirror of
https://github.com/golang/go
synced 2024-11-22 00:34:40 -07:00
The Go programming language
7a09a88274
Much of the bulk of Go binaries is the symbol tables, which give a name to every C string, Go string, and reflection type symbol. These names are not worth much other than seeing what's where in a binary. This CL deletes all those names from the symbol table, instead aggregating the symbols into contiguous blocks and giving them the names "string.*", "go.string.*", and "type.*". Before: $ 6nm $(which godoc.old) | sort | grep ' string\.' | tail -10 59eda4 D string."aa87ca22be8b05378eb1c71... 59ee08 D string."b3312fa7e23ee7e4988e056... 59ee6c D string."func(*token.FileSet, st... 59eed0 D string."func(io.Writer, []uint8... 59ef34 D string."func(*tls.Config, *tls.... 59ef98 D string."func(*bool, **template.... 59effc D string."method(p *printer.print... 59f060 D string."method(S *scanner.Scann... 59f12c D string."func(*struct { begin in... 59f194 D string."method(ka *tls.ecdheRSA... $ After: $ 6nm $(which godoc) | sort | grep ' string\.' | tail -10 5e6a30 D string.* $ Those names in the "Before" are truncated for the CL. In the real binary they are the complete string, up to a certain length, or else a unique identifier. The same applies to the type and go.string symbols. Removing the names cuts godoc by more than half: -rwxr-xr-x 1 rsc rsc 9153405 2011-03-07 23:19 godoc.old -rwxr-xr-x 1 rsc rsc 4290071 2011-03-07 23:19 godoc For what it's worth, only 80% of what's left gets loaded into memory; the other 20% is dwarf debugging information only ever accessed by gdb: -rwxr-xr-x 1 rsc rsc 3397787 2011-03-07 23:19 godoc.nodwarf R=r, cw CC=golang-dev https://golang.org/cl/4245072 |
||
---|---|---|
doc | ||
include | ||
lib | ||
misc | ||
src | ||
test | ||
.hgignore | ||
.hgtags | ||
AUTHORS | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README | ||
robots.txt |
This is the source code repository for the Go programming language. For documentation about how to install and use Go, visit http://golang.org/ or load doc/install.html in your web browser. After installing Go, you can view a nicely formatted doc/install.html by running godoc --http=:6060 and then visiting http://localhost:6060/doc/install.html. Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file. -- Binary Distribution Notes If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this README). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install.html). You should also add the Go binary directory $GOROOT/bin to your shell's path. For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile: export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin See doc/install.html for more details.