]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: reduce lexer allocs when parsing numeric constants
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 24 Feb 2015 20:54:57 +0000 (20:54 +0000)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 26 Feb 2015 01:46:16 +0000 (01:46 +0000)
commit9f4c25e2236617c27e5b430c774b4d9c4b86ba1b
tree55e6c6df2e163abc7d852c9b70751b2f4f94bb10
parent1d4bfb3ebb1cbe3807c8623cf8ad594346c80cc3
cmd/gc: reduce lexer allocs when parsing numeric constants

This reduces the number of allocs when
running the rotate.go tests by
about 20%, after applying CL 5700.

Combining

s = "const str"
s += <another string>

generally saves an alloc and might be a candidate for
rsc's grind tool. However, I'm sending this CL now
because this also reuses the result of calling lexbuf.String.

Change-Id: If3a7300b7da9612ab62bb910ee90349dca88dde3
Reviewed-on: https://go-review.googlesource.com/5821
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/internal/gc/lex.go