mirror of
https://github.com/golang/go
synced 2024-11-24 02:30:12 -07:00
The Go programming language
0e97f4187e
As much as 7x speedup on some programs, cuts all.bash time by 20%. Change splicebefore function from O(n) to O(1). The approach was suggested by Carl during the code's review but apparently did not make it into the tree. It makes a huge difference on huge programs. Make twobitwalktype1 slightly faster by using & instead of %. Really it needs to be cached; left a note to that effect. (Not a complete fix, hence the ½.) big.go (output of test/chan/select5.go) 47.53u 0.50s 48.14r before this CL 7.09u 0.47s 7.59r with splicebefore change (6.7x speedup) 6.15u 0.42s 6.59r with twobitwalktype1 change (1.15x speedup; total 7.7x) slow.go (variant of program in go.text, by mpvl) 77.75u 2.11s 80.03r before this CL 24.40u 1.97s 26.44r with splicebefore change (3.2x speedup) 18.12u 2.19s 20.38r with twobitwalktype1 change (1.35x speedup; total 4.3x) test/run 150.63u 49.57s 81.08r before this CL 88.01u 45.60s 46.65r after this CL (1.7x speedup) all.bash 369.70u 115.64s 256.21r before this CL 298.52u 110.35s 214.67r after this CL (1.24x speedup) The test programs are at https://rsc.googlecode.com/hg/testdata/big.go (36k lines, 276kB) https://rsc.googlecode.com/hg/testdata/slow.go (7k lines, 352kB) R=golang-codereviews, gobot, r CC=cshapiro, golang-codereviews https://golang.org/cl/43210045 |
||
---|---|---|
api | ||
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-source.html in your web browser. After installing Go, you can view a nicely formatted doc/install-source.html by running godoc --http=:6060 and then visiting http://localhost:6060/doc/install/source. 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.