4e0618c992
This will simplify parsing of rational and (eventually) floating point numbers. Also streamlined inner loop. As a result, scan runs faster for all but short (<= 10 digit) numbers. For short numbers it is < 10% slower (cause is known and could be addressed in a future CL). Minor unrelated cleanups. Added additional tests. benchmark old ns/op new ns/op delta BenchmarkScanPi 134465 125122 -6.95% BenchmarkScan10Base2 493 540 +9.53% BenchmarkScan100Base2 3608 3244 -10.09% BenchmarkScan1000Base2 35376 32377 -8.48% BenchmarkScan10000Base2 481504 450028 -6.54% BenchmarkScan100000Base2 17936774 17648080 -1.61% BenchmarkScan10Base8 258 280 +8.53% BenchmarkScan100Base8 1389 1323 -4.75% BenchmarkScan1000Base8 14221 13036 -8.33% BenchmarkScan10000Base8 271298 258993 -4.54% BenchmarkScan100000Base8 15715465 15672580 -0.27% BenchmarkScan10Base10 249 268 +7.63% BenchmarkScan100Base10 1324 1220 -7.85% BenchmarkScan1000Base10 13398 12234 -8.69% BenchmarkScan10000Base10 259157 249342 -3.79% BenchmarkScan100000Base10 15670613 15582409 -0.56% BenchmarkScan10Base16 231 251 +8.66% BenchmarkScan100Base16 1093 1065 -2.56% BenchmarkScan1000Base16 12687 12196 -3.87% BenchmarkScan10000Base16 282349 271443 -3.86% BenchmarkScan100000Base16 16742669 16552917 -1.13% Change-Id: I4b9b078792788aef872b307399f00ffd34903127 Reviewed-on: https://go-review.googlesource.com/2960 Reviewed-by: Alan Donovan <adonovan@google.com> |
||
---|---|---|
api | ||
doc | ||
include | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.
Our canonical Git repository is located at https://go.googlesource.com/go. (There is a mirror of the repository at https://github.com/golang/go.)
Please report issues here: https://golang.org/issue/new
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Please note that we do not use pull requests.
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 file). 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-source.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 https://golang.org/doc/install or doc/install.html for more details.