cmd/compile: make only one new Node in defaultlit
defaultlit and friends sometimes create a new OLITERAL node, only to have replace it. Thread hints when that is unnecessary. name old time/op new time/op delta Template 318ms ± 6% 322ms ± 4% ~ (p=0.154 n=24+25) Unicode 162ms ± 6% 151ms ± 7% -6.94% (p=0.000 n=22+23) GoTypes 1.04s ± 1% 1.04s ± 3% ~ (p=0.136 n=20+25) Compiler 5.08s ± 2% 5.10s ± 4% ~ (p=0.788 n=25+25) MakeBash 41.4s ± 1% 41.5s ± 1% ~ (p=0.084 n=25+25) name old user-ns/op new user-ns/op delta Template 438M ±10% 441M ± 9% ~ (p=0.418 n=25+25) Unicode 272M ± 5% 219M ± 5% -19.33% (p=0.000 n=24+21) GoTypes 1.51G ± 3% 1.51G ± 3% ~ (p=0.500 n=25+25) Compiler 7.31G ± 3% 7.32G ± 3% ~ (p=0.572 n=25+24) name old alloc/op new alloc/op delta Template 57.3MB ± 0% 57.2MB ± 0% -0.16% (p=0.000 n=25+25) Unicode 41.1MB ± 0% 38.7MB ± 0% -5.81% (p=0.000 n=25+25) GoTypes 191MB ± 0% 191MB ± 0% -0.06% (p=0.000 n=25+25) Compiler 840MB ± 0% 839MB ± 0% -0.12% (p=0.000 n=25+25) name old allocs/op new allocs/op delta Template 500k ± 0% 500k ± 0% -0.12% (p=0.000 n=24+25) Unicode 400k ± 0% 384k ± 0% -4.16% (p=0.000 n=25+25) GoTypes 1.50M ± 0% 1.49M ± 0% -0.05% (p=0.000 n=25+25) Compiler 6.04M ± 0% 6.03M ± 0% -0.11% (p=0.000 n=25+25) Change-Id: I2fda5e072db67ba239848bde827c7deb2ad4abae Reviewed-on: https://go-review.googlesource.com/20813Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Showing
Please
register
or
sign in
to comment