]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/compile/internal/gc: improve comparison with constant strings
authorIlya Tocar <ilya.tocar@intel.com>
Tue, 28 Mar 2017 20:30:31 +0000 (15:30 -0500)
committerIlya Tocar <ilya.tocar@intel.com>
Fri, 7 Apr 2017 15:40:25 +0000 (15:40 +0000)
commite4a500ce1490a5db709da5880f0121e5eeac73cd
tree99bc58f9a1d58b9f2824db56a55e575d857b6f66
parentd206af1e6c53df0c59d9466fe9c50415f9d8dcd5
cmd/compile/internal/gc: improve comparison with constant strings

Currently we expand comparison with small constant strings into len check
and a sequence of byte comparisons. Generate 16/32/64-bit comparisons,
instead of bytewise on 386 and amd64. Also increase limits on what is
considered small constant string.
Shaves ~30kb (0.5%) from go executable.

This also updates test/prove.go to keep test case valid.

Change-Id: I99ae8871a1d00c96363c6d03d0b890782fa7e1d9
Reviewed-on: https://go-review.googlesource.com/38776
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/asm_test.go
src/cmd/compile/internal/gc/walk.go
test/prove.go