]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove NewPtr/NewSlice calls with untyped string
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Fri, 9 Oct 2020 16:26:30 +0000 (23:26 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Sat, 10 Oct 2020 00:55:54 +0000 (00:55 +0000)
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>
src/cmd/compile/internal/gc/ssa.go

index 08144bace30402a332310dbc0f159a3daac0e4c7..e363f4f723d679016758a12334bca99fa90f66f2 100644 (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