• Robert Griesemer's avatar
    cmd/compile/internal/syntax: add position info for { and } braces · e0329248
    Robert Griesemer authored
    This change adds position information for { and } braces in the
    source. There's a 1.9% increase in memory use for syntax.Nodes,
    which is negligible relative to overall compiler memory consumption.
    
    Parsing the std library (using syntax package only) and memory
    consumption before this change (fastest of 5 runs):
    
      $ go test -run StdLib -fast
      parsed 1516827 lines (3392 files) in 780.612335ms (1943124 lines/s)
      allocated 379.903Mb (486.673Mb/s)
    
    After this change (fastest of 5 runs):
    
      $ go test -run StdLib -fast
      parsed 1517022 lines (3394 files) in 793.487886ms (1911840 lines/s)
      allocated 387.086Mb (267B/line, 487.828Mb/s)
    
    While not an exact apples-to-apples comparison (the syntax package
    has changed and is also parsed), the overall impact is small.
    
    Also: Small improvements to nodes_test.go.
    
    Change-Id: Ib8a7f90bbe79de33d83684e33b1bf8dbc32e644a
    Reviewed-on: https://go-review.googlesource.com/38435Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
    e0329248
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...