1
0
mirror of https://github.com/golang/go synced 2024-11-27 03:51:30 -07:00

cmd/compile: remove NewPtr/NewSlice calls with untyped string

This is follow up of CL 260699, NewPtr/NewSlice should not be called
with untyped string.

No significal change in performance.

name          old time/op       new time/op       delta
Template            167ms ± 5%        168ms ± 6%    ~     (p=0.549 n=9+10)
Unicode            73.9ms ±21%       69.5ms ± 5%    ~     (p=0.182 n=10+9)
GoTypes             611ms ± 4%        603ms ± 2%    ~     (p=0.356 n=10+9)
Compiler            3.07s ± 4%        3.05s ± 2%    ~     (p=0.356 n=9+10)
SSA                 7.61s ± 3%        7.49s ± 1%  -1.67%  (p=0.017 n=10+9)
Flate               114ms ±10%        110ms ±12%    ~     (p=0.165 n=10+10)
GoParser            148ms ±23%        138ms ±13%    ~     (p=0.436 n=9+9)
Reflect             377ms ± 9%        364ms ± 8%    ~     (p=0.105 n=10+10)
Tar                 149ms ±12%        151ms ±12%    ~     (p=0.315 n=10+10)
XML                 201ms ± 3%        206ms ± 8%    ~     (p=0.237 n=8+10)
LinkCompiler        308ms ± 3%        325ms ± 9%  +5.38%  (p=0.017 n=9+10)
[Geo mean]          352ms             348ms       -1.19%

Passes toolstash-check.

Change-Id: I1ca8e9635f1926e53e457bc06648fa08a5473bf3
Reviewed-on: https://go-review.googlesource.com/c/go/+/260859
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Cuong Manh Le 2020-10-09 23:26:30 +07:00
parent 712cba3bf2
commit d317ba5d44

View File

@ -50,12 +50,10 @@ func initssaconfig() {
// Caching is disabled in the backend, so generating these here avoids allocations.
_ = types.NewPtr(types.Types[TINTER]) // *interface{}
_ = types.NewPtr(types.NewPtr(types.Types[TSTRING])) // **string
_ = types.NewPtr(types.NewPtr(types.UntypedString)) // **string
_ = types.NewPtr(types.NewSlice(types.Types[TINTER])) // *[]interface{}
_ = types.NewPtr(types.NewPtr(types.Bytetype)) // **byte
_ = types.NewPtr(types.NewSlice(types.Bytetype)) // *[]byte
_ = types.NewPtr(types.NewSlice(types.Types[TSTRING])) // *[]string
_ = types.NewPtr(types.NewSlice(types.UntypedString)) // *[]string
_ = types.NewPtr(types.NewPtr(types.NewPtr(types.Types[TUINT8]))) // ***uint8
_ = types.NewPtr(types.Types[TINT16]) // *int16
_ = types.NewPtr(types.Types[TINT64]) // *int64