diff options
author | R?my Oudompheng <oudomphe@phare.normalesup.org> | 2013-09-12 00:15:28 +0200 |
---|---|---|
committer | R?my Oudompheng <oudomphe@phare.normalesup.org> | 2013-09-12 00:15:28 +0200 |
commit | e60a79aa081976b8737f89ad94bd305d26e44249 (patch) | |
tree | 1a7e0374649eaa6a947b150779c9f3805dfc1273 /src/cmd/gc/builtin.c | |
parent | 6ea0016d314880cc438edb1faa919d9e63178a76 (diff) | |
download | go-e60a79aa081976b8737f89ad94bd305d26e44249.tar.gz |
cmd/gc: inline copy in frontend to call memmove directly.
A new node type OSPTR is added to refer to the data pointer of
strings and slices in a simple way during walk(). It will be
useful for future work on simplification of slice arithmetic.
benchmark old ns/op new ns/op delta
BenchmarkCopy1Byte 9 8 -13.98%
BenchmarkCopy2Byte 14 8 -40.49%
BenchmarkCopy4Byte 13 8 -35.04%
BenchmarkCopy8Byte 13 8 -37.10%
BenchmarkCopy12Byte 14 12 -15.38%
BenchmarkCopy16Byte 14 12 -17.24%
BenchmarkCopy32Byte 19 14 -27.32%
BenchmarkCopy128Byte 31 26 -15.29%
BenchmarkCopy1024Byte 100 92 -7.50%
BenchmarkCopy1String 10 7 -28.99%
BenchmarkCopy2String 10 7 -28.06%
BenchmarkCopy4String 10 8 -22.69%
BenchmarkCopy8String 10 8 -23.30%
BenchmarkCopy12String 11 11 -5.88%
BenchmarkCopy16String 11 11 -5.08%
BenchmarkCopy32String 15 14 -6.58%
BenchmarkCopy128String 28 25 -10.60%
BenchmarkCopy1024String 95 95 +0.53%
R=golang-dev, bradfitz, cshapiro, dave, daniel.morsing, rsc, khr, khr
CC=golang-dev
https://codereview.appspot.com/9101048
Diffstat (limited to 'src/cmd/gc/builtin.c')
-rw-r--r-- | src/cmd/gc/builtin.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cmd/gc/builtin.c b/src/cmd/gc/builtin.c index baa7d7845..77deece47 100644 --- a/src/cmd/gc/builtin.c +++ b/src/cmd/gc/builtin.c @@ -94,6 +94,7 @@ char *runtimeimport = "func @\"\".block ()\n" "func @\"\".makeslice (@\"\".typ·2 *byte, @\"\".nel·3 int64, @\"\".cap·4 int64) (@\"\".ary·1 []any)\n" "func @\"\".growslice (@\"\".typ·2 *byte, @\"\".old·3 []any, @\"\".n·4 int64) (@\"\".ary·1 []any)\n" + "func @\"\".memmove (@\"\".to·1 *any, @\"\".frm·2 *any, @\"\".length·3 uintptr)\n" "func @\"\".memequal (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" "func @\"\".memequal8 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" "func @\"\".memequal16 (@\"\".eq·1 *bool, @\"\".size·2 uintptr, @\"\".x·3 *any, @\"\".y·4 *any)\n" |