go/src
Robert Griesemer 3fc327b33b go/scanner: 17% faster scanning
- Changed the Scan API semantics slightly:
The token literal string is only returned
if the token is a literal, comment, semicolon,
or illegal character. In all other cases, the
token literal value is determined by the token
value.

Clients that care about the token literal value
when not present can always use the following
piece of code:

pos, tok, lit := scanner.Scan()
if lit == "" {
   lit = tok.String()
}

- Changed token.Lookup API to use a string instead
of a []byte argument.

- Both these changes were long-standing TODOs.

- Added BenchmarkScan.

This change permits a faster implementation of Scan
with much fewer string creations:

benchmark                old ns/op    new ns/op    delta
scanner.BenchmarkScan        74404        61457  -17.40%

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5532076
2012-01-11 14:20:32 -08:00
..
cmd go/scanner: 17% faster scanning 2012-01-11 14:20:32 -08:00
lib9 lib9: fix windows build 2011-11-07 14:16:00 -05:00
libbio
libmach os: OS-dependent bits to support NetBSD. 2011-12-15 12:19:19 -05:00
pkg go/scanner: 17% faster scanning 2012-01-11 14:20:32 -08:00
Make.ccmd build: explain $PWD use 2011-06-22 17:00:46 -04:00
Make.clib build: explain $PWD use 2011-06-22 17:00:46 -04:00
Make.cmd build: pass $GCFLAGS to compiler 2011-10-18 14:55:10 -04:00
Make.common
Make.inc ld: allow for IMAGE_REL_AMD64_ADDR32NB relocation type 2011-12-16 10:32:14 +11:00
Make.pkg testing: use flag.Duration for -timeout flag. 2011-12-25 16:07:05 +11:00
all-qemu.bash build: update all-qemu.bash 2011-07-28 13:04:30 -04:00
all.bash
buildinfo.sh build: fix build 2011-12-20 17:00:52 -05:00
buildscript.sh buildscript: make script safer, same output on Windows 2011-12-21 15:58:05 -05:00
buildscript_darwin_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_darwin_amd64.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_freebsd_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_freebsd_amd64.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_linux_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_linux_amd64.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_linux_arm.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_netbsd_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_netbsd_amd64.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_openbsd_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_openbsd_amd64.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_plan9_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_windows_386.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
buildscript_windows_amd64.sh go/doc: first steps towards cleaning up go/doc 2012-01-09 16:14:01 -08:00
clean.bash test/bench/go1: first draft of Go 1 benchmark suite 2011-12-15 12:32:59 -05:00
env.bash build: use go command during build 2011-12-20 16:50:13 -05:00
make.bash cmd/go: add -v flag to build and install 2012-01-09 16:44:01 -08:00
quietgcc.bash build: handle spaces in $USER 2011-07-28 13:04:52 -04:00
run.bash cmd/go: add -v flag to build and install 2012-01-09 16:44:01 -08:00
sudo.bash sudo.bash: print error/exit if problem with /usr/local/bin 2011-09-01 17:24:32 +10:00
version.bash version.bash: update VERSION on -save if already present 2011-08-24 22:10:25 -03:00